PageSourceSearch

https://nybiltester.no/wp-content/themes/nybiltester/js/main.js?v=1791502489.6809

js nybiltester.no collected 2026-10-08 23:35:04 UTC 2,932 bytes, 133 lines download raw bytes

1$(document).ready(function() {
2	init();
3
4	$(document).on("click", function(event){
5		if (!event.target.matches('.merkerBtn')) {
6      $(".merker-content").slideUp('fast');
7  	}
8  	if (!event.target.matches('.typerBtn')) {
9      $(".typer-content").slideUp('fast');
10  	}
11  	if (!event.target.matches('.drivstoffBtn')) {
12      $(".drivstoff-content").slideUp('fast');
13  	}
14  });
15});
16
17$(window).on('scroll', function (e) {
18
19});
20
21
22$(window).on('resize', function () {
23	dataRatio();
24	dataImage();
25});
26
27function init() {
28	dataRatio();
29  dataImage();
30  dataImageBG();
31  dataColorBG();
32  mobileMenu();
33	masonry();
34	wrapIframe();
35	setSearchPlaceholder();
36}
37
38function mobileMenu() {
39	$('.burger').click(function () {
40		if($('body').hasClass('open')) {
41	    $('body').removeClass('open');
42	    $('.menu').slideUp();
43		}
44    else {
45	    $('body').addClass('open');
46	    $('.menu').slideDown();
47    }
48  });
49}
50
51function dataRatio() {
52  $('.ratio').each(function (i, e) {
53		$(e).height($(e).width() * $(e).data('ratio'));
54  });
55}
56
57function dataColorBG() {
58  $('.bg-color').each(function (i, e) {
59		$(e).css('background-color', $(e).data('bgcolor'));
60  });
61}
62
63function dataImageBG() {
64	$('.bg-img, .parallax').each(function(i, e) {
65		var w = $(e).width();
66		var list = $(e).data('image');
67		var img = list.w320;
68		if(w > 320) { img = list.w480; }
69		if(w > 480) { img = list.w768; }
70		if(w > 768) { img = list.w1024; }
71		if(w > 1024) { img = list.w1440; }
72		if(w > 1440) { img = list.w1680; }
73		if(w > 1680) { img = list.w1920; }
74		$(e).css('background-image', 'url(' + img + ')');
75  });
76
77  $('.bg-img-single').each(function(i, e) {
78		var img = $(e).data('image');
79		$(e).css('background-image', 'url(' + img + ')');
80  });
81}
82
83function dataImage() {
84	$('.img').each(function(i, e) {
85		var w = $(e).parent().width();
86		var list = $(e).data('image');
87		var img = list.w320;
88		if(w > 320) { img = list.w480; }
89		if(w > 480) { img = list.w768; }
90		if(w > 768) { img = list.w1024; }
91		if(w > 1024) { img = list.w1440; }
92		if(w > 1440) { img = list.w1680; }
93		if(w > 1680) { img = list.w1920; }
94		$(e).attr('src', img);
95  });
96}
97
98function masonry() {
99	var $grid = $('.masonry').imagesLoaded( function() {
100	  $grid.masonry({
101	    itemSelector: '.masonry--item'
102	  });
103
104	  //$('.front--post ul>li').addClass('loaded');
105	});
106}
107
108function asideShow() {
109	$('body').addClass('open');
110}
111
112function asideHide() {
113	$('body').removeClass('open');
114}
115
116function toggleDropdown(target) {
117	$(target).slideToggle('fast');
118}
119
120function wrapIframe() {
121	$('iframe').wrap('<div class="embed-container"></div>');
122}
123
124function setSearchPlaceholder() {
125	$('#search-input').attr('placeholder', 'Søk');
126	/*
127	$('#search-input').focus(function() {
128    $(this).attr('placeholder', 'Søk')
129	}).blur(function() {
130    $(this).attr('placeholder', '')
131	});
132	*/
133}

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.