Advertisement
Guest User

vovajs

a guest
Nov 24th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. <?php if(!isset($_COOKIE['handshow'])){ ?>
  2. <script type="text/javascript" src="static/js/exit.js"></script>
  3. <script type="text/javascript" src="static/js/exit2.js"></script>
  4. <?php if($lang=="en"){ ?>
  5. <div style="display: none; padding: 10px;" id="exit_content">
  6. <img src="images/stop.png"><br /><br />
  7. <h11>Do you really want to leave our website ?</h11><br><br>
  8. <h11>Click to close window,</h11><br><br>
  9. <h11>to stay on our website.</h11><br>
  10. </div>
  11. <?php }elseif($lang=="ru"){ ?>
  12. <div style="display: none; padding: 10px;" id="exit_content">
  13. <img src="images/stop.png"><br /><br />
  14. <h11>Вы действительно хотите покинуть наш сайт ?</h11><br><br>
  15. <h11>Нажмите закрыть окно,</h11><br><br>
  16. <h11>чтоб остаться на нашем сайте.</h11><br>
  17. </div>
  18. <?php }elseif($lang=="ua"){ ?>
  19. <div style="display: none; padding: 10px;" id="exit_content">
  20. <img src="images/stop.png"><br /><br />
  21. <h11>Ви дійсно хочете залишити наш веб-сайт ?</h11><br><br>
  22. <h11>Натисніть закрити вікно,</h11><br><br>
  23. <h11>щоб залишитись на нашому сайті.</h11><br>
  24. </div>
  25.  
  26. <?php }elseif($lang=="de"){ ?>
  27. <div style="display: none; padding: 10px;" id="exit_content">
  28. <img src="images/stop.png"><br /><br />
  29. <h11>DO YOU REALLY WANT TO LEAVE OUR WEBSITE ?</h11><br><br>
  30. <h11>CLICK TO CLOSE WINDOW,</h11><br><br>
  31. <h11>TO STAY ON OUR WEBSITE.</h11><br>
  32. </div>
  33.  
  34. <?php }} ?>
  35.  
  36.  
  37. var is_showed = false;
  38. $(document).ready(function() {
  39. $(document).mousemove(function(e) {
  40. if(e.pageY <= 10 && is_showed == false)
  41. {
  42. is_showed = true;
  43. var date = new Date( new Date().getTime() + 60*60*24*30*1000 );
  44. setCookie("handshow", 1, { expires: date.toUTCString() });
  45. $('#exit_content').modal({onOpen: modalOpen, onClose: simplemodal_close});
  46. }
  47. });
  48. });
  49. function modalOpen (dialog) {
  50. dialog.overlay.fadeIn('fast', function () {
  51. dialog.container.fadeIn('fast', function () {
  52. dialog.data.hide().slideDown('fast');
  53. });
  54. });
  55. }
  56. function simplemodal_close (dialog) {
  57. dialog.data.fadeOut('fast', function () {
  58. dialog.container.hide('fast', function () {
  59. dialog.overlay.slideUp('fast', function () {
  60. $.modal.close();
  61. });
  62. });
  63. });
  64. }
  65. function setCookie(name, value, options)
  66. {
  67. options = options || {};
  68.  
  69. var expires = options.expires;
  70.  
  71. if (typeof expires == "number" && expires) {
  72. var d = new Date();
  73. d.setTime(d.getTime() + expires*1000);
  74. expires = options.expires = d;
  75. }
  76. if (expires && expires.toUTCString) {
  77. options.expires = expires.toUTCString();
  78. }
  79.  
  80. value = encodeURIComponent(value);
  81.  
  82. var updatedCookie = name + "=" + value;
  83.  
  84. for(var propName in options) {
  85. updatedCookie += "; " + propName;
  86. var propValue = options[propName];
  87. if (propValue !== true) {
  88. updatedCookie += "=" + propValue;
  89. }
  90. }
  91.  
  92. document.cookie = updatedCookie;
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement