Advertisement
anatolionobre

Overlay Sticker (autopromo)

Feb 20th, 2014
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">
  2.  
  3.  
  4. var DFPoverlayTitle= "Personalidades Masculinas 2013";
  5. var DFPoverlayText= "VOTE NO SEU FAVORITO!";
  6.  
  7.  
  8.  
  9. </script>
  10.  
  11. <img src="%%VIEW_URL_UNESC%%http://s0.2mdn.net/dot.gif" width="1" height="1" style="display:none"/>
  12.  
  13. <script type="text/javascript">
  14. if (window.jQuery) {(function(b){b.gritter={};b.gritter.options={position:"",class_name:"",fade_in_speed:"medium",fade_out_speed:1000,time:6000};b.gritter.add=function(f){try{return a.add(f||{})}catch(d){var c="Gritter Error: "+d;(typeof(console)!="undefined"&&console.error)?console.error(c,f):alert(c)}};b.gritter.remove=function(d,c){a.removeSpecific(d,c||{})};b.gritter.removeAll=function(c){a.stop(c||{})};var a={position:"",fade_in_speed:"",fade_out_speed:"",time:"",_custom_timer:0,_item_count:0,_is_setup:0,_tpl_close:'<a class="gritter-close" href="#" tabindex="1">Close Notification</a>',_tpl_title:'<span class="gritter-title">[[title]]</span>',_tpl_item:'<div id="gritter-item-[[number]]" class="gritter-item-wrapper [[item_class]]" style="display:none" role="alert"><div class="gritter-top"></div><div class="gritter-item">[[close]][[image]]<div class="[[class_name]]">[[title]]<p>[[text]]</p></div><div style="clear:both"></div></div><div class="gritter-bottom"></div></div>',_tpl_wrap:'<div id="gritter-notice-wrapper"></div>',add:function(g){if(typeof(g)=="string"){g={text:g}}if(g.text===null){throw'You must supply "text" parameter.'}if(!this._is_setup){this._runSetup()}var k=g.title,n=g.text,e=g.image||"",l=g.sticky||false,m=g.class_name||b.gritter.options.class_name,j=b.gritter.options.position,d=g.time||"";this._verifyWrapper();this._item_count++;var f=this._item_count,i=this._tpl_item;b(["before_open","after_open","before_close","after_close"]).each(function(p,q){a["_"+q+"_"+f]=(b.isFunction(g[q]))?g[q]:function(){}});this._custom_timer=0;if(d){this._custom_timer=d}var c=(e!="")?'<img src="'+e+'" class="gritter-image" />':"",h=(e!="")?"gritter-with-image":"gritter-without-image";if(k){k=this._str_replace("[[title]]",k,this._tpl_title)}else{k=""}i=this._str_replace(["[[title]]","[[text]]","[[close]]","[[image]]","[[number]]","[[class_name]]","[[item_class]]"],[k,n,this._tpl_close,c,this._item_count,h,m],i);if(this["_before_open_"+f]()===false){return false}b("#gritter-notice-wrapper").addClass(j).append(i);var o=b("#gritter-item-"+this._item_count);o.fadeIn(this.fade_in_speed,function(){a["_after_open_"+f](b(this))});if(!l){this._setFadeTimer(o,f)}b(o).bind("mouseenter mouseleave",function(p){if(p.type=="mouseenter"){if(!l){a._restoreItemIfFading(b(this),f)}}else{if(!l){a._setFadeTimer(b(this),f)}}a._hoverState(b(this),p.type)});b(o).find(".gritter-close").click(function(){a.removeSpecific(f,{},null,true);return false;});return f},_countRemoveWrapper:function(c,d,f){d.remove();this["_after_close_"+c](d,f);if(b(".gritter-item-wrapper").length==0){b("#gritter-notice-wrapper").remove()}},_fade:function(g,d,j,f){var j=j||{},i=(typeof(j.fade)!="undefined")?j.fade:true,c=j.speed||this.fade_out_speed,h=f;this["_before_close_"+d](g,h);if(f){g.unbind("mouseenter mouseleave")}if(i){g.animate({opacity:0},c,function(){g.animate({height:0},300,function(){a._countRemoveWrapper(d,g,h)})})}else{this._countRemoveWrapper(d,g)}},_hoverState:function(d,c){if(c=="mouseenter"){d.addClass("hover");d.find(".gritter-close").show()}else{d.removeClass("hover");d.find(".gritter-close").hide()}},removeSpecific:function(c,g,f,d){if(!f){var f=b("#gritter-item-"+c)}this._fade(f,c,g||{},d)},_restoreItemIfFading:function(d,c){clearTimeout(this["_int_id_"+c]);d.stop().css({opacity:"",height:""})},_runSetup:function(){for(opt in b.gritter.options){this[opt]=b.gritter.options[opt]}this._is_setup=1},_setFadeTimer:function(f,d){var c=(this._custom_timer)?this._custom_timer:this.time;this["_int_id_"+d]=setTimeout(function(){a._fade(f,d)},c)},stop:function(e){var c=(b.isFunction(e.before_close))?e.before_close:function(){};var f=(b.isFunction(e.after_close))?e.after_close:function(){};var d=b("#gritter-notice-wrapper");c(d);d.fadeOut(function(){b(this).remove();f()})},_str_replace:function(v,e,o,n){var k=0,h=0,t="",m="",g=0,q=0,l=[].concat(v),c=[].concat(e),u=o,d=c instanceof Array,p=u instanceof Array;u=[].concat(u);if(n){this.window[n]=0}for(k=0,g=u.length;k<g;k++){if(u[k]===""){continue}for(h=0,q=l.length;h<q;h++){t=u[k]+"";m=d?(c[h]!==undefined?c[h]:""):c[0];u[k]=(t).split(l[h]).join(m);if(n&&u[k]!==t){this.window[n]+=(t.length-u[k].length)/l[h].length}}}return p?u:u[0]},_verifyWrapper:function(){if(b("#gritter-notice-wrapper").length==0){b("body").append(this._tpl_wrap)}}}})(jQuery);}
  15. </script>
  16.  
  17.    <style type="text/css">
  18. #gritter-notice-wrapper{position:fixed;top:20px;right:20px;width:301px;z-index:9999}
  19. #gritter-notice-wrapper.top-left{left:20px;right:auto}
  20. #gritter-notice-wrapper.bottom-right{top:auto;left:auto;bottom:20px;right:20px}
  21. #gritter-notice-wrapper.bottom-left{top:auto;right:auto;bottom:20px;left:20px}
  22. .gritter-item-wrapper{position:relative;background:url(http://pagead2.googlesyndication.com/pagead/imgad?id=CICAgKDj2ZaLRhABGAEoATIIbm2aKJYLQzRAgaGYmAU);margin:0 0 10px}
  23. .gritter-top{background:url(http://pagead2.googlesyndication.com/pagead/imgad?id=CICAgKDj2ZamARABGAEoATIIM0lI3YqQ0fNAv6GYmAU) no-repeat left -30px;height:10px}
  24. .hover .gritter-top{background-position:right -30px}
  25. .gritter-bottom{background:url(http://pagead2.googlesyndication.com/pagead/imgad?id=CICAgKDj2ZamARABGAEoATIIM0lI3YqQ0fNAv6GYmAU) no-repeat left bottom;height:8px;margin:0}
  26. .hover .gritter-bottom{background-position:bottom right}
  27. .gritter-item{display:block;background:url(http://pagead2.googlesyndication.com/pagead/imgad?id=CICAgKDj2ZamARABGAEoATIIM0lI3YqQ0fNAv6GYmAU) no-repeat left -40px;color:#eee;font-size:11px;font-family:verdana;padding:2px 11px 8px}
  28. .hover .gritter-item{background-position:right -40px}
  29. .gritter-item p{word-wrap:break-word;color:#999;margin:0;padding:0}
  30. .gritter-close{display:none;position:absolute;top:5px;left:3px;background:url(http://pagead2.googlesyndication.com/pagead/imgad?id=CICAgKDj2ZamARABGAEoATIIM0lI3YqQ0fNAv6GYmAU) no-repeat left top;cursor:pointer;width:30px;height:30px;text-indent:-9999em}
  31. .gritter-title{font-size:14px;font-weight:700;display:block;text-shadow:1px 1px 0 #000;padding:0 0 7px}
  32. .gritter-image{width:48px;height:48px;float:left}
  33. .gritter-with-image,.gritter-without-image{padding:0}
  34. .gritter-with-image{width:220px;float:right}
  35. .gritter-light .gritter-item,.gritter-light .gritter-bottom,.gritter-light .gritter-top,.gritter-light .gritter-close{background-image:url(http://pagead2.googlesyndication.com/pagead/imgad?id=CICAgKDj2da2MRABGAEoATIIqqhD13NL0TNA76GYmAU);color:#222}
  36. .gritter-light .gritter-title{text-shadow:none}
  37. </style>
  38.  
  39.    <script  type="text/javascript">
  40.    
  41.    
  42.    $(document).ready(function() {
  43.                 //$(window).scroll(function() {
  44.                  //   if ($(window).scrollTop() == 400) {
  45.                 //      $(window).unbind('scroll');
  46.                        
  47.                 $.extend($.gritter.options, {
  48.                     //class_name: 'gritter-light', // for light notifications (can be added directly to $.gritter.add too)
  49.                     position: 'bottom-right', // possibilities: bottom-left, bottom-right, top-left, top-right
  50.                     fade_in_speed: 100, // how fast notifications fade in (string or int)
  51.                     fade_out_speed: 100, // how fast the notices fade out
  52.                     time: 10000 // hang on the screen for...
  53.                 });
  54.        
  55.                        
  56.                        
  57.                 $.gritter.add({
  58.                     // (string | mandatory) the heading of the notification
  59.                     title: '<a style="#fff" href="%%CLICK_URL_ESC%%%%DEST_URL%%">'+DFPoverlayTitle+'</a>',
  60.                     // (string | mandatory) the text inside the notification
  61.                    
  62.                     text: '<a style="color: #fff" href="%%CLICK_URL_ESC%%%%DEST_URL%%">'+DFPoverlayText+'</a>',
  63.                     // (string | optional) the image to display on the left
  64.                     image: '%%FILE:JPG1%%',
  65.  
  66.                     // Stickeh!
  67.                     sticky: true,
  68.                     // (int | optional) the time you want it to be alive for before fading out
  69.                     time: '',
  70.                     // (function | optional) function called before it opens
  71.                     before_open: function(){
  72.                         //alert('I am a sticky called before it opens');
  73.                     },
  74.                     // (function | optional) function called after it opens
  75.                     after_open: function(e){
  76.                         //alert("I am a sticky called after it opens: \nI am passed the jQuery object for the created Gritter element...\n" + e);
  77.                     },
  78.                     // (function | optional) function called before it closes
  79.                     before_close: function(e){
  80.                         //alert("I am a sticky called before it closes: I am passed the jQuery object for the Gritter element... \n" + e);
  81.                     },
  82.                     // (function | optional) function called after it closes
  83.                     after_close: function(){
  84.                         //alert('I am a sticky called after it closes');
  85.                     }
  86.                 });
  87.                        
  88.                        
  89.                  //   }
  90.                // });
  91.             });    
  92.  
  93.  
  94.             </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement