PageSourceSearch

https://www.grazia.it/content/themes/grazia/js/grazia-template.js?ver=1

js grazia.it collected 2026-10-02 05:48:33 UTC 13,023 bytes, 284 lines download raw bytes

1/*! GRAZIA  */
2
3// on window ready...
4jQuery( window ).load(function() {
5
6	// checkbox checked al click sulla label
7	jQuery('.dropdown-scroll li').each(function() {
8	    jQuery(this).click(function() {
9	        var checkBoxesShop = jQuery(this).children('.regular-checkbox');
10	        checkBoxesShop.prop("checked", !checkBoxesShop.prop("checked"));
11	    });
12	});
13	
14	// custom scrollbar shop
15	if (jQuery('.scroll-pane').length != 0) {
16	    jQuery('.dropdown-toggle').each(function() {
17	        jQuery(this).click(function() {
18	        jQuery(this).siblings('.scroll-pane').toggle();
19	        jQuery(this).siblings('.scroll-pane').jScrollPane( {
20	                verticalDragMinHeight: 20,
21	                verticalDragMaxHeight: 20,
22	                showArrows: true
23	                }
24	            );
25	        });
26	    });
27	}
28	
29	// overlay per menu
30    jQuery('#header .hamburgermenu').hover(function() {
31        jQuery('#header .hamburgermenu .icon-menu').toggleClass('over');
32    });
33
34    // Slider NAPA
35    if (jQuery('.slider-NAPA').length != 0) {
36    	if(jQuery(window).width() < 768 ) {
37	        varNAPASwiper = new Swiper ('.slider-NAPA', {
38	            grabCursor          : true,
39	            direction           : 'horizontal',
40	            pagination          : '.swiper-pagination'
41	        });
42	    } else { // versione >= 768
43	        var lastColNAPA = jQuery('.bloccoNAPA .slider-NAPA li:last-child h2').html();
44	        jQuery('.bloccoNAPA .slider-NAPA li:last-child').remove();
45	        jQuery('.bloccoNAPA .slider-NAPA li:last-child').append('<hr class="clear" /><h2 class="next-title last-title">'+lastColNAPA+'</h2>');
46	    }
47    }
48
49    // Slider "POTREBBE INTERESARTI" e versione < 960
50    if (jQuery('#potrebbe-interessarti').length != 0 && findBootstrapEnvironment() == "xs") {
51
52        $('#potrebbe-interessarti').swiper({
53            grabCursor          : true,
54            direction           : 'horizontal',
55            calculateHeight     : true,
56            centeredSlides      : false,
57            onInit: function () { 
58                if (isIE() && isIE() <= 9) { // fix slider IE9/IE8
59                    jQuery('#potrebbe-interessarti ul.swiper-wrapper').css("width","9999px");
60                }
61            }
62
63        });
64
65    }
66
67    jQuery('#header.homepage').data('size','big');
68
69    // nascondi crocini pag ponte se ultimi della fila
70    var quando = '';
71    var sparisci = 0;
72
73    if (jQuery(window).width() >= 768) { quando = 3; }
74    if (jQuery(window).width() >= 960) { quando = 4; }
75
76    var thumbs = $('article .fotgallery-ponte span.icon-cross');
77    thumbs.each(function(i){
78        sparisci++;
79        if ( sparisci == quando ) {
80            thumbs.eq(i).addClass('hidden');
81            sparisci=0;
82        }
83    });
84
85    HeaderTitleWidth();
86
87    //apertura wide in homepage del sito
88    var Hfotoapertura = (jQuery('#HPlancio1-sm img#grazia-opening').height())*-1;
89    jQuery('section#HPlancio1-sm .adv-apertura').css('top',Hfotoapertura+'px');
90//    jQuery('section#HPlancio1-sm').css('min-height',advInfo.rn_1.height+'px');        
91    
92    /** Per mancanza di tempo mi è impossibile correggerli tutti, ma almeno per
93     * sfilate utilizziamo le funzioni di bootstrap visto che ci sono già.
94     * Prima era jQuery('.explore-btn') TROPPO GENERICO
95     */ 
96    jQuery('#headingHPITBlogs .explore-btn, #headingHPITGirls .explore-btn').click( function() {
97        jQuery('.explore-menu, .icon-down-arrow').toggleClass('hidden-xs');
98    });
99
100    //blocco "i blog di <ITGIRL>" in foglia ITBlogs
101    if (jQuery(window).width() >= 960) {
102        var fintaspallaH = jQuery('.foglia-ITBlogs .fintaspalla').outerHeight();
103        var videoblockH = jQuery('.foglia-ITBlogs .itgirl-video').parent('ul').outerHeight();
104        var diffheight = ((fintaspallaH-videoblockH)*-1)+'px';
105        jQuery('.foglia-ITBlogs .i-blog-di').css('margin-top',diffheight);
106    }
107
108    // altezza box tags foglia ITGirls
109    if (jQuery(window).width() >= 960) {
110        var girlboxtagsH = jQuery('.foglia-ITGirls .itgirl-evidenziata').outerHeight()+30;
111        jQuery('.foglia-ITGirls .itgirl-evidenziata').css('margin-top',(-girlboxtagsH));
112    } 
113
114});
115
116// on PAGE resize...
117jQuery( window ).resize(function() {
118
119    // custom scrollbar shop on resize
120    if (jQuery('.scroll-pane').length != 0) {
121        jQuery('.scroll-pane').toggle().css('display','none');
122        jQuery('.scroll-pane').jScrollPane( {
123            verticalDragMinHeight: 20,
124            verticalDragMaxHeight: 20,
125            showArrows: true
126        });
127    }
128	HeaderTitleWidth();
129
130	//apertura wide in homepage del sito
131    var Hfotoapertura = (jQuery('#HPlancio1-sm img#grazia-opening').height())*-1;
132    jQuery('section#HPlancio1-sm .adv-apertura').css('top',Hfotoapertura+'px');
133   // jQuery('section#HPlancio1-sm').css('min-height',advInfo.rn_1.height+'px');        
134    
135    //blocco "i blog di <ITGIRL>" in foglia ITBlogs
136    if (jQuery(window).width() >= 960) {
137        var fintaspallaH = jQuery('.foglia-ITBlogs .fintaspalla').outerHeight();
138        var videoblockH = jQuery('.foglia-ITBlogs .itgirl-video').parent('ul').outerHeight();
139        var diffheight = ((fintaspallaH-videoblockH)*-1)+'px';
140        jQuery('.foglia-ITBlogs .i-blog-di').css('margin-top',diffheight);
141        jQuery('.foglia-ITBlogs .fintaspalla').addClass('margin-bottom');
142    } else { 
143        jQuery('.foglia-ITBlogs .i-blog-di').css('margin-top','0');
144        jQuery('.foglia-ITBlogs .fintaspalla').removeClass('margin-bottom');
145	}
146});
147
148
149(function($) {
150    $(function () {
151        var startPos = 0;
152        var windowSize = findBootstrapEnvironment();
153        var $clonedHeader = null;
154        const $_header = $('.home #header.homepage');
155
156        if ($_header.length && windowSize !== "xs") {
157            $clonedHeader = $_header
158                .clone()
159                .addClass("cloned-header-menu contracted")
160                .css({top: -$_header.outerHeight() + "px"})
161                .insertAfter($_header);
162
163            $clonedHeader.find("#in-evidenza").addClass("hidden");
164        }
165        $(window).on("scroll", function () {
166            // header: si vede solo se scrollo in alto (solo per mobile)
167            if (windowSize == "xs") {
168                jQuery('#header.homepage').stop().css({  height:'70px'  });
169                clearTimeout($.data(this, 'scrollTimer'));
170                $.data(this, 'scrollTimer', setTimeout(function() {
171                    var st = $(this).scrollTop();
172                    var headerHeight = jQuery('#header').outerHeight();
173                    var headerSfilateHeight = (jQuery('#header-sottocanale-menu').length) ? jQuery('#header-sottocanale-menu').outerHeight() : 0;
174                    if (st > startPos){
175                        window.hiddenStickyHeader = - headerHeight;
176                        if (jQuery("#header-sottocanale-collapse").hasClass("in")) {
177                            window.sottocanaleStickyHeader = 0;
178                        } else {
179                            window.sottocanaleStickyHeader = - headerSfilateHeight;
180                        }
181                        jQuery('#header').stop().animate({  top: window.hiddenStickyHeader + 'px'  },200);
182                        jQuery('#header-sottocanale-menu').stop().animate({  top: window.sottocanaleStickyHeader + 'px'  },200);
183                   } else if (st < (startPos - 100)){ // -100 serve a mostrare l'header solo in caso di scroll convinto
184                        window.hiddenStickyHeader = 0;
185                        window.sottocanaleStickyHeader = headerHeight;
186                        jQuery('#header').stop().animate({  top: window.hiddenStickyHeader + 'px'  },200);
187                        jQuery('#header-sottocanale-menu').stop().animate({  top: window.sottocanaleStickyHeader + 'px'  },200);
188                   }
189                   startPos = st;
190                }, 100));
191            } else {// header: cambio dimensione (solo da tablet in poi)
192                if ($_header.length ) {
193                    var scrollTop = $(this).scrollTop();
194                    if (scrollTop >= $_header.outerHeight()) {
195                        const wpadminbarHeight = $("#wpadminbar").outerHeight() || 0;
196                        $clonedHeader.css("top", wpadminbarHeight + "px");
197                    } else {
198                        $clonedHeader.css("top", -$_header.outerHeight()  + "px");
199                    }
200                } else {
201                    if(jQuery(document).scrollTop() > 30 ) {
202                        if (jQuery('#header.homepage').data("size") != "small" && jQuery('#header.homepage').data("animating") != true) {
203                            jQuery('#header.homepage').data("animating", true);
204                           jQuery('#header.homepage, .hp-sticky-spacer').animate({
205                               height:'70px'
206                           },200, function(){
207                             jQuery('#header.homepage').data("animating", false).data("size", "small");
208                         });
209                           jQuery('#header.homepage').addClass('contracted');
210                       }
211
212                        //solo se HP canale
213                       jQuery('#header.HPcanale .stickyonly').removeClass('hidden');
214                       jQuery('#header.HPcanale h1').addClass('col-sm-push-1');
215                   } else {
216                       if (jQuery('#header.homepage').data("size") != "big" && jQuery('#header.homepage').data("animating") != true) {
217                          jQuery('#header.homepage').data("animating", true);
218                          jQuery('#header.homepage, .hp-sticky-spacer').animate({
219                           height:'230px'
220                       },200, function(){
221                         jQuery('#header.homepage').data("animating", false).data("size", "big");
222                     });
223                          jQuery('#header.homepage').removeClass('contracted');
224                      }
225
226                        //solo se HP canale
227                      jQuery('#header.HPcanale .stickyonly').addClass('hidden');
228                      jQuery('#header.HPcanale h1').removeClass('col-sm-push-1');
229                  }
230                }
231            }
232        });
233    });
234})(jQuery);
235
236// header articolo: titolo 
237function HeaderTitleWidth() {
238	var sidelogoW=jQuery('.sidelogo').width();
239	var fixeditem=jQuery('.sidelogo > span').outerWidth(true);
240	var fixeditem2=jQuery('.sidelogo > .article-category').outerWidth(true);
241	var resultWidth = (sidelogoW-(fixeditem+fixeditem2))-10;  //10px tolerance 
242
243	jQuery('.sidelogo > .article-title').css('width',resultWidth+'px');
244}
245
246function isIE () {
247  var myNav = navigator.userAgent.toLowerCase();
248  return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;
249}
250
251
252/**
253 * se in home c'è una pubblicità altissima
254 */
255function mediamondCallbackAdvSize(id,height) {
256	console.log("mediamondCallbackAdvSize "+id+" "+height);
257	if (id=="adv-gpt-box-container1") {
258		    if (height == '600' && jQuery(window).width()<=1024) {  
259	            jQuery(".hot-topics").css("padding-top","67px");
260	        }
261	        if (height != '600' && jQuery(window).width()<=1024) {  
262	            jQuery(".hot-topics").css("padding-top","0");
263	        }
264	    
265	}
266
267	//se arriva pubblicità alta e sono in una gallery, faccio spazio
268	if (id.substr(0,28)=="adv-gpt-box-mobile-container") {
269		jQuery(".swiper-container").each(function(){
270			if (jQuery("#"+id,this).length>0) {
271				jQuery(this).css("padding-bottom","290px");
272			}
273		}); 
274	}
275	
276}
277
278
279
280/*
281CSS Browser Selector v0.4.0 (Nov 02, 2010)
282http://rafael.adm.br/css_browser_selector
283*/
284function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.