Home > JavaScript > wyskakujące okno pop up

wyskakujące okno pop up

Dodane przez: piciu
opis:
wyskakujące okienko z napisem
Kod:
  1. <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js' type='text/javascript'></script>
  2. <style>
  3. #fbox-background {
  4. display: none;
  5. background: rgba(0,0,0,0.8);
  6. width: 100%;
  7. height: 100%;
  8. position: fixed;
  9. top: 0;
  10. left: 0;
  11. z-index: 99999;
  12. }
  13.  
  14. #fbox-close {
  15. width: 100%;
  16. height: 100%;
  17. }
  18.  
  19. #fbox-display {
  20. background: #eaeaea;
  21. border: 5px solid #828282;
  22. width: 340px;
  23. height: 230px;
  24. position: absolute;
  25. top: 32%;
  26. left: 37%;
  27. -webkit-border-radius: 5px;
  28. -moz-border-radius: 5px;
  29. border-radius: 5px;
  30. }
  31.  
  32. #fbox-button {
  33. float: right;
  34. cursor: pointer;
  35. position: absolute;
  36. right: 0px;
  37. top: 0px;
  38. }
  39.  
  40. #fbox-button:before {
  41. content: "ZAMKNIJ";
  42. padding: 5px 8px;
  43. background: #828282;
  44. color: #eaeaea;
  45. font-weight: bold;
  46. font-size: 10px;
  47. font-family: Tahoma;
  48. }
  49.  
  50. #fbox-link,#fbox-link a.visited,#fbox-link a,#fbox-link a:hover {
  51. color: #aaaaaa;
  52. font-size: 9px;
  53. text-decoration: none;
  54. text-align: center;
  55. padding: 5px;
  56. }
  57. </style>
  58. <script type='text/javascript'>
  59. //<![CDATA[
  60. jQuery.cookie = function (key, value, options) {
  61. // key and at least value given, set cookie...
  62. if (arguments.length > 1 && String(value) !== "[object Object]") {
  63. options = jQuery.extend({}, options);
  64. if (value === null || value === undefined) {
  65. options.expires = -1;
  66. }
  67. if (typeof options.expires === 'number') {
  68. var days = options.expires, t = options.expires = new Date();
  69. t.setDate(t.getDate() + days);
  70. }
  71. value = String(value);
  72. return (document.cookie = [
  73. encodeURIComponent(key), '=',
  74. options.raw ? value : encodeURIComponent(value),
  75. options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
  76. options.path ? '; path=' + options.path : '',
  77. options.domain ? '; domain=' + options.domain : '',
  78. options.secure ? '; secure' : ''
  79. ].join(''));
  80. }
  81. // key and possibly options given, get cookie...
  82. options = value || {};
  83. var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
  84. return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
  85. };
  86. //]]>
  87. </script>
  88. <script type='text/javascript'>
  89. jQuery(document).ready(function($){
  90. if($.cookie('popup_facebook_box') != 'yes'){
  91. $('#fbox-background').delay(5000).fadeIn('medium');
  92. $('#fbox-button, #fbox-close').click(function(){
  93. $('#fbox-background').stop().fadeOut('medium');
  94. });
  95. }
  96. $.cookie('popup_facebook_box', 'yes', { path: '/', expires: 7 });
  97. });
  98. </script>
  99. <div id='fbox-background'>
  100. <div id='fbox-close'>
  101. </div>
  102. <div id='fbox-display'>
  103. <div id='fbox-button'>
  104. </div>
  105. <br><br><br><br><br>
  106. <center> Witaj na stronie dodatkidostron.xaa.pl
  107. </div>
  108. </div>

©