Advertisement
nanerbk8

Caixa curtir no Blogger com opção fechar - JS - #1

Jun 30th, 2012
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js?ver=3.3.1'
  2. type='text/javascript'/>
  3. <script type='text/javascript'>
  4. //<![CDATA[
  5. jQuery.cookie = function (key, value, options) {
  6.    
  7.     // key and at least value given, set cookie...
  8.     if (arguments.length > 1 && String(value) !== "[object Object]") {
  9.         options = jQuery.extend({}, options);
  10.  
  11.         if (value === null || value === undefined) {
  12.             options.expires = -1;
  13.         }
  14.  
  15.         if (typeof options.expires === 'number') {
  16.             var days = options.expires, t = options.expires = new Date();
  17.             t.setDate(t.getDate() + days);
  18.         }
  19.        
  20.         value = String(value);
  21.        
  22.         return (document.cookie = [
  23.             encodeURIComponent(key), '=',
  24.             options.raw ? value : encodeURIComponent(value),
  25.             options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
  26.             options.path ? '; path=' + options.path : '',
  27.             options.domain ? '; domain=' + options.domain : '',
  28.             options.secure ? '; secure' : ''
  29.         ].join(''));
  30.     }
  31.  
  32.     // key and possibly options given, get cookie...
  33.     options = value || {};
  34.     var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
  35.     return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
  36. };
  37. //]]>
  38. </script>
  39. <script type='text/javascript'>
  40. jQuery(document).ready(function($){
  41. if($.cookie('popup_user_login') != 'yes'){
  42. $('#fanback').delay(100).fadeIn('medium');
  43. $('#fanclose, #fan-exit').click(function(){
  44. $('#fanback').stop().fadeOut('medium');
  45. });
  46. }
  47. $.cookie('popup_user_login', 'yes', { path: '/', expires: 7 });
  48. });
  49. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement