PageSourceSearch

https://penstore.se/themes/penstoreTheme/design/script/header.js

js penstore.se collected 2026-09-26 01:40:51 UTC 6,099 bytes, 228 lines download raw bytes

1/*---------------------------------------------------------------------------------
2   Site: 
3   COPYRIGHT (c) ASKÅS INTERNET- & REKLAMBYRÅ AB 1997-2020. ALL RIGHTS RESERVED.
4---------------------------------------------------------------------------------*/
5/*var sticky_navigation_offset_top = jQuery('.logo').offset().top - 24;*/
6/*var headerHeight1 = jQuery('.header-wrapper').height();
7    console.log('höjd', headerHeight1);*/
8
9
10jQuery.noConflict();
11jQuery(document).ready(function($) {
12	/*sticky_navigation();
13	mobile_search();
14	desktop_search();*/
15
16
17    jQuery('.close-cta').click(function(){ 
18    	jQuery('body').addClass('no-cta');
19    	jQuery('.cta').removeClass('show');
20        jQuery('.header-wrapper').css({'position': 'fixed'});
21    	jQuery.cookie('CTA', 'closed', { expires: null, path: '/' }); 
22    	/*sticky_navigation_offset_top = jQuery('.logo').offset().top - 24;*/
23
24        
25
26        jQuery( window ).resize(function() {
27            if (jQuery(window).width() < 1145) {/*767*/
28              
29            } else {
30              jQuery('.calc').css({'height': '110px'});
31              jQuery('.header-wrapper').css({'position': 'fixed'});
32            }
33        }).resize();
34
35  	});
36
37	if (typeof jQuery.cookie('CTA') === 'undefined'){ 
38		jQuery('.cta').addClass('show');
39		jQuery('body').removeClass('no-cta');
40        /*console.log('cta finns');*/
41        
42
43        jQuery( window ).resize(function() {
44            if (jQuery(window).width() < 1145) {/*767*/
45                jQuery('.calc').css('height', '0px');
46            } else {
47              jQuery('.calc').css({'height': '158px'});
48              jQuery('.header-wrapper').css({'position': 'fixed'});
49            }
50        }).resize();
51
52		/*sticky_navigation_offset_top = jQuery('.logo').offset().top - 24;*/
53		
54	} else {
55		jQuery('.cta').removeClass('show');
56		jQuery('body').addClass('no-cta');
57
58        jQuery( window ).resize(function() {
59            if (jQuery(window).width() < 1145) {/*767*/
60              jQuery('.calc').css('height', '0px');
61              jQuery('.header-wrapper').css({'position': 'fixed'});
62            } else {
63              jQuery('.calc').css('height', '110px');
64              jQuery('.header-wrapper').css({'position': 'fixed'});
65            }
66        }).resize();
67
68		/*sticky_navigation();*/
69	}
70
71
72    /* Nytt */
73    /*var headerHeight = jQuery('.header-wrapper').outerHeight();
74    console.log('hH', headerHeight);*/
75
76    /*jQuery('#main').css('padding-top', headerHeight);*/
77    // jQuery('.calc').css('height', headerHeight);
78
79
80    
81
82    // run our function on load
83    sticky_navigation2();
84
85 
86});    
87
88/* Nytt */
89     
90// and run it again every time you scroll
91jQuery(window).scroll(function() {
92     sticky_navigation2();
93
94});
95
96/*var headerHeightCalc = jQuery('.header-wrapper').height();
97console.log('hHC', headerHeightCalc);*/
98
99/*var headerHeighten = jQuery('.header-wrapper').height();
100console.log('headerHeighten =',headerHeighten);*/
101
102
103var sticky_navigation_offset_top2 = jQuery('.wrapper').offset().top + 200;
104if(jQuery(window).width() < 1145) {
105    sticky_navigation_offset_top2 -= 150;
106}
107var sticky_navigation2 = function(){
108    /*console.log("scroll");*/
109    var flag = "top";
110
111    var scroll_top = jQuery(window).scrollTop(); 
112
113    if (scroll_top > sticky_navigation_offset_top2) {
114
115        jQuery('body').addClass('scroll');
116
117        jQuery( window ).resize(function() {
118            if (jQuery(window).width() < 1145) {/*767*/
119              
120            } else {
121                
122                jQuery('.sokrutan').detach().appendTo('.sok-scroll');
123                
124            }
125        }).resize();
126        
127    } else if (scroll_top <= sticky_navigation_offset_top2) {
128
129        jQuery('body').removeClass('scroll');
130        jQuery('body').removeClass('scroll-meny');
131        if(scroll_top != 0)
132            jQuery('body').removeClass('modal-open-left-xs');
133
134
135
136        jQuery( window ).resize(function() {
137            if (jQuery(window).width() < 1145) {/*767*/
138              
139            } else {
140              
141              jQuery('.sokrutan').detach().appendTo('.sok-original');
142              jQuery('.canvas-left-module-xs').removeClass('active');
143                
144                
145            }
146        }).resize();
147        
148    }  
149};
150
151
152
153
154
155/*jQuery(window).scroll(function() {
156    sticky_navigation(sticky_navigation_offset_top);
157    mobile_search();
158    desktop_search();
159   
160});*/
161
162/*var sticky_navigation = function(sticky_navigation_offset_top){
163	
164    var scroll_top = jQuery(window).scrollTop(); 
165    if (scroll_top > sticky_navigation_offset_top) {
166        jQuery('body').addClass('scroll');
167        jQuery('body').removeClass('base');
168    } else {
169        jQuery('body').removeClass('scroll');
170        
171
172        jQuery('body').addClass('base');
173        jQuery('body').removeClass('modal-open-left-xs');
174        jQuery('body').removeClass('scroll-meny');
175
176        jQuery( window ).resize(function() {
177            if (jQuery(window).width() < 767) {
178              
179            } else {
180              
181              jQuery('.canvas-left-module-xs').removeClass('active');
182            }
183        }).resize();
184       
185
186        
187    }  
188};*/
189
190
191/*var mobile_search_offset_top = jQuery('.sokrutan').offset().top;
192var mobile_search = function(){ 
193    var scroll_top = jQuery(window).scrollTop(); 
194    if (scroll_top > mobile_search_offset_top) {
195        jQuery('.sokrutan').addClass('mob');
196
197    } else {
198
199    	if (jQuery(".sokrutan.mob").length > 0) {
200			
201			jQuery('.sokrutan').addClass('upp'); 
202		}
203		else{}
204
205        jQuery('.sokrutan').removeClass('mob');
206        
207    }  
208};*/
209
210/*var desktop_search_offset_top = jQuery('.upper').offset().top;
211var desktop_search = function(){
212    var scroll_top = jQuery(window).scrollTop(); 
213    if (scroll_top > desktop_search_offset_top) {
214        jQuery('.sokrutan').addClass('test');
215     
216
217        jQuery('#main').addClass('test2');
218    } else {
219       
220        jQuery('.sokrutan').removeClass('test');
221        jQuery('.sokrutan').removeClass('upp');
222
223        jQuery('#main').removeClass('test2');
224    }  
225};*/
226    
227
228

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.