PageSourceSearch

https://www.versales.com/js/custom.js?v1=?v=1.2.6

js versales.com collected 2026-09-29 12:49:02 UTC 9,034 bytes, 304 lines download raw bytes

1// moved from put_javascript.cfm
2function keepshopping(){
3	$("#modalWindow").html('');
4	//$('#modalWindow').foundation('close');	
5	$('#minicartModal').modal('dispose');
6	location.reload();
7}
8
9// off-canvas : https://as-tx.github.io/bootstrap-off-canvas-sidebar/
10// jQuery(document).ready(function($){
11// 	$(document).on('click', '.pull-bs-canvas-right, .pull-bs-canvas-left', function(){
12// 		$('body').prepend('<div class="bs-canvas-overlay bg-dark position-fixed w-100 h-100"></div>');
13// 		if($(this).hasClass('pull-bs-canvas-right'))
14// 			$('.bs-canvas-right').addClass('mr-0');
15// 		else
16// 			$('.bs-canvas-left').addClass('ml-0');
17// 		return false;
18// 	});
19
20// 	$(document).on('click', '.bs-canvas-close, .bs-canvas-overlay', function(){
21// 		var elm = $(this).hasClass('bs-canvas-close') ? $(this).closest('.bs-canvas') : $('.bs-canvas');
22// 		elm.removeClass('mr-0 ml-0');
23// 		$('.bs-canvas-overlay').remove();
24// 		return false;
25// 	});
26// });
27
28
29/// offcanvas for Bootstrap 4 : https://bootstrap-menu.com/_bootstrap4/demos/offcanvas-desktop.html
30
31// jquery ready start
32$(document).ready(function() {
33  // jQuery code
34
35    $("[data-trigger]").on("click", function(e){
36        e.preventDefault();
37        e.stopPropagation();
38        var offcanvas_id =  $(this).attr('data-trigger');
39        $(offcanvas_id).toggleClass("show");
40        $('body').toggleClass("offcanvas-active");
41        $(".screen-overlay").toggleClass("show");
42
43    }); 
44
45
46    // Close menu when pressing ESC
47    $(document).on('keydown', function(event) {
48        if(event.keyCode === 27) {
49           $(".offcanvas").removeClass("show");
50           $("body").removeClass("overlay-active");
51        }
52    });
53
54    $(".btn-close, .screen-overlay").click(function(e){
55      $(".screen-overlay").removeClass("show");
56        $(".offcanvas").removeClass("show");
57        $("body").removeClass("offcanvas-active");
58
59
60    }); 
61  
62}); // jquery end
63
64
65// format phone number US - http://jsfiddle.net/VpNMA/2560/
66$('#phone-number').keydown(function (e) {
67	var key = e.which || e.charCode || e.keyCode || 0;
68	$phone = $(this);
69
70	// Don't let them remove the starting '('
71	if ($phone.val().length === 1 && (key === 8 || key === 46)) {
72		$phone.val('('); 
73		return false;
74	} else if ($phone.val().charAt(0) !== '(') { // Reset if they highlight and type over first char.
75		$phone.val('('+String.fromCharCode(e.keyCode)+''); 
76	}
77
78	// Auto-format- do not expose the mask as the user begins to type
79	if (key !== 8 && key !== 9) {
80		if ($phone.val().length === 4) {
81			$phone.val($phone.val() + ')');
82		}
83		if ($phone.val().length === 5) {
84			$phone.val($phone.val() + ' ');
85		}			
86		if ($phone.val().length === 9) {
87			$phone.val($phone.val() + '-');
88		}
89	}
90
91	// Allow numeric (and tab, backspace, delete) keys only
92	return (key == 8 || key == 9 || key == 46 ||
93			(key >= 48 && key <= 57) ||
94			(key >= 96 && key <= 105));	
95}).bind('focus click', function () {
96	$phone = $(this);
97	
98	if ($phone.val().length === 0) {
99		$phone.val('(');
100	}
101	else {
102		var val = $phone.val();
103		$phone.val('').val(val); // Ensure cursor remains at the end
104	}
105}).blur(function () {
106	$phone = $(this);
107	
108	if ($phone.val() === '(') {
109		$phone.val('');
110	}
111});
112// END :: moved from put_javascript.cfm
113
114/* owl carousel*/
115$('.owl-carousel-product').owlCarousel({
116    nav:true,
117    items:1,
118    loop:true,
119    center:true
120});
121
122$('.loop').owlCarousel({
123    center: true,
124    items:2,
125    loop:true,
126    nav:true,
127    dots:false,
128    margin:10,
129    responsive:{
130        600:{
131            items:4
132        }
133    }
134});
135
136/* slick */
137$('.variable-width').slick({
138    arrows: true,
139    dots: false,
140    infinite: true,
141    speed: 300,
142    slidesToShow: 3,
143    slidesToScroll: 1,
144    centerMode: true,
145    variableWidth: true,
146    responsive: [
147    {
148      breakpoint: 480,
149      settings: {
150        arrows: true,
151        slidesToShow: 1,
152        slidesToScroll: 1,
153        adaptiveHeight: true
154      }
155    }]
156});
157
158setTimeout(function(){ 
159    $( '#sel_image_desc').html($( ".slick-center" ).find('.description').html()); 
160    $( '#sel_image_desc').fadeIn('slow');
161    //$( ".slick-active" ).find('.description').css( "display", "block" ); 
162}, 500);
163$('.slick-next').click(function() {
164    //$( ".slick-active" ).find('.description').css( "display", "block" );
165    $( '#sel_image_desc').hide();
166    $( '#sel_image_desc').html($( ".slick-center" ).find('.description').html());
167    $( '#sel_image_desc').fadeIn('slow');
168});
169$('.slick-prev').click(function() {
170    //$( ".slick-active" ).find('.description').css( "display", "block" );
171    $( '#sel_image_desc').hide();
172    $( '#sel_image_desc').html($( ".slick-center" ).find('.description').html());
173    $( '#sel_image_desc').fadeIn('slow');
174});
175$('.variable-width').on( "swipe", function( event ) {
176    $( '#sel_image_desc').hide();
177    $( '#sel_image_desc').html($( ".slick-center" ).find('.description').html());
178    $( '#sel_image_desc').fadeIn('slow');
179});
180
181// open login modal in case of error
182var urlParams = new URLSearchParams(window.location.search);
183if(urlParams.has('errormess') && urlParams.get('errormess')>0){
184	$('.header-nav-features-dropdown-mobile-fixed').addClass('show');
185}
186
187/* thumb gallery */
188$(document).ready(function() {
189
190    var sync1 = $("#sync1");
191    var sync2 = $("#sync2");
192	var sync3 = $("#sync3");
193    var slidesPerPage = 4; //globaly define number of elements per page
194    var syncedSecondary = true;
195	var syncedThird = true;
196
197    sync1.owlCarousel({
198        items: 1,
199        slideSpeed: 2000,
200        nav: true,
201        autoplay: false, 
202        dots: false,
203        loop: false,
204        responsiveRefreshRate: 200,
205        navText: ['<svg width="100%" height="100%" viewBox="0 0 11 20"><path style="fill:none;stroke-width: 1px;stroke: #000;" d="M9.554,1.001l-8.607,8.607l8.607,8.606"/></svg>', '<svg width="100%" height="100%" viewBox="0 0 11 20" version="1.1"><path style="fill:none;stroke-width: 1px;stroke: #000;" d="M1.054,18.214l8.606,-8.606l-8.606,-8.607"/></svg>'],
206    }).on('changed.owl.carousel', syncPosition);
207
208    sync2
209        .on('initialized.owl.carousel', function() {
210			sync2.find(".owl-item").eq(0).addClass("current");
211			sync2.find(".owl-item").eq(0).css('border','2px solid #212121');
212        })
213        .owlCarousel({
214            items: slidesPerPage,
215            dots: false,
216            nav: false,
217            smartSpeed: 200,
218			slideSpeed: 500,
219			margin: 10,
220            slideBy: slidesPerPage, //alternatively you can slide by 1, this way the active slide will stick to the first item in the second carousel
221            responsiveRefreshRate: 100
222        }).on('changed.owl.carousel', syncPosition2);
223		
224	
225		
226		sync3.owlCarousel({
227        items: 4,
228        slideSpeed: 2000,
229        nav: true,
230        autoplay: false, 
231        dots: false,
232        loop: false,
233        responsiveRefreshRate: 100,
234     }).on('changed.owl.carousel', syncPosition);
235
236    function syncPosition(el) {
237        //if you set loop to false, you have to restore this next line
238        //var current = el.item.index;
239
240        //if you disable loop you have to comment this block
241        var count = el.item.count - 1;
242        //var current = Math.round(el.item.index - (el.item.count / 2) - .5);
243        var current = el.item.index;
244
245        if (current < 0) {
246            current = count;
247        }
248        if (current > count) {
249            current = 0;
250        }
251
252        //end block
253
254        sync2
255            .find(".owl-item")
256            .removeClass("current")
257            .eq(current)
258			.addClass("current");
259		sync2
260			.find(".owl-item")
261			.css('border','0')
262            .eq(current)
263            .css('border','2px solid #212121');
264        var onscreen = sync2.find('.owl-item.active').length - 1;
265        var start = sync2.find('.owl-item.active').first().index();
266        var end = sync2.find('.owl-item.active').last().index();
267
268        if (current > end) {
269            sync2.data('owl.carousel').to(current, 100, true);
270        }
271        if (current < start) {
272            sync2.data('owl.carousel').to(current - onscreen, 100, true);
273        }
274    }
275
276    function syncPosition2(el) {
277        if (syncedSecondary) {
278            var number = el.item.index;
279            sync1.data('owl.carousel').to(number, 100, true);
280        }
281    }
282
283    sync2.on("click", ".owl-item", function(e) {
284        e.preventDefault();
285        var number = $(this).index();
286        sync1.data('owl.carousel').to(number, 300, true);
287    });
288	
289	
290	
291});
292
293//----------------------------------------//
294if ($("#shiptoyes").is(':checked')){
295    $('#shipinfo').hide();
296}
297
298$("#shiptoyes").click(function(e){
299    if($("#shiptoyes").is(':checked')){
300        $('#shipinfo').hide();
301    }
302    else
303        $('#shipinfo').show();
304})

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.