PageSourceSearch

https://www.longwoods.com/blog/wp-content/themes/longwoodsv2/assets/js/main.js

js longwoods.com collected 2026-10-09 16:46:48 UTC 12,758 bytes, 455 lines download raw bytes

1// JavaScript Document
2$(document).ready(function() {
3    function openNav() {
4        document.getElementById("mySidenav").style.width = "70%";
5        // document.getElementById("flipkart-navbar").style.width = "50%";
6        document.body.style.backgroundColor = "rgba(0,0,0,0.4)";
7    }
8
9    function closeNav() {
10        document.getElementById("mySidenav").style.width = "0";
11        document.body.style.backgroundColor = "rgba(0,0,0,0)";
12    }
13
14    $('button').click(function() {
15        $('.sidebar').toggleClass('fliph');
16    });
17
18    $(window).scroll(function() {
19
20
21        var header_height = $('#top_picks').height();
22        //$('.banner-section-case-study').css("margin-top",header_height+"px")
23        $(window).on('resize', function() {
24            var header_height = $('#top_picks').height();
25            // $('.banner-section-case-study').css("margin-top",header_height+"px")
26        });
27
28        var scroll = $(window).scrollTop();
29        var contentHeight = window.innerHeight;
30        var footerPosition = $('#footer_main').position();
31        var footerHeight = $('#footer_main').innerHeight();
32        var mainHeight = footerPosition.top - contentHeight;
33        if (scroll >= mainHeight) {
34            $("#right-side-add-home-page.move_add_from_footer").css("top", -footerHeight / 1.6 + "px");
35        } else {
36            $("#right-side-add-home-page").css("top", (header_height + 20));
37        }
38    });
39
40    // Close All Popup
41    $(".close_popup").click(function() {
42        $(".sign_inBox").hide();
43        $(".sign_upBox").hide();
44        $(".sign_upBox_thankyou").hide();
45        jQuery('.external_popup').modal('hide');
46        $(".error_msg").hide();
47    });
48
49    // Login Popup
50    $(".sign_register").click(function() {
51        $(".sign_inBox").show();
52        $(".sign_upBox").hide();
53        $(".sign_upBox_thankyou").hide();
54        $(".error_msg").hide();
55        $("#login_email").val("");
56        $("#login_password").val("");
57    });
58
59    // Registration Popup
60    $(".signup_register").click(function() {
61        $(".sign_inBox").hide();
62        $(".sign_upBox").show();
63        $(".sign_upBox_thankyou").hide();
64        $(".error_msg").hide();
65    });
66
67    $(window).scroll(function() {
68        var scroll = $(window).scrollTop();
69        if (scroll >= 90) {
70            $(".sign_inBox").addClass("fix_login");
71            $(".sign_upBox").addClass("fix_login");
72            $(".sign_upBox_thankyou").addClass("fix_login");
73
74        } else {
75            $(".sign_inBox").removeClass("fix_login");
76            $(".sign_upBox").removeClass("fix_login");
77            $(".sign_upBox_thankyou").removeClass("fix_login");
78        }
79    });
80
81    // $(document).ready(function() {
82    //     $('.left_social_icon').on('click', function() {
83    //         $('#sidebar').toggleClass('active');
84    //     });
85    // });
86
87
88    /* Check width on page load*/
89    if ($(window).width() < 991) {
90        $('#sidebar').removeClass('active');
91    } else { $('#sidebar').addClass('active'); }
92    
93     if ($(window).width() >= 991) {
94        $('#sidebar .list-unstyled').click(function(e) {
95            $('#sidebar').removeClass('active');
96        });
97    } else {  
98        $('#sidebar .list-unstyled').click(function(e) {
99            $('#sidebar').addClass('active');
100        });
101    }
102});
103
104
105
106
107
108
109$(window).resize(function() {
110    /*If browser resized, check width again */
111    if ($(window).width() < 991) {
112        $('#sidebar').removeClass('active');
113    } else { $('#sidebar').addClass('active'); }
114
115});
116
117
118
119(function($) {
120    $(document).ready(function() {
121        var $chatbox = $('.chatbox'),
122            $chatboxTitle = $('.chatbox__title'),
123            $chatboxTitleClose = $('.chatbox__title__close'),
124            $chatboxCredentials = $('.chatbox__credentials');
125        $chatboxTitle.on('click', function() {
126            $chatbox.toggleClass('chatbox--tray');
127        });
128        $chatboxTitleClose.on('click', function(e) {
129            e.stopPropagation();
130            $chatbox.addClass('chatbox--closed');
131        });
132        $chatbox.on('transitionend', function() {
133            if ($chatbox.hasClass('chatbox--closed'))
134                $chatbox.remove();
135        });
136        $chatboxCredentials.on('submit', function(e) {
137            e.preventDefault();
138            $chatbox.removeClass('chatbox--empty');
139        });
140    });
141})(jQuery);
142
143
144equalheight = function(container) {
145    var currentTallest = 0,
146        currentRowStart = 0,
147        rowDivs = new Array(),
148        $el,
149        topPosition = 0;
150    $(container).each(function() {
151
152        $el = $(this);
153        $($el).height('auto')
154        topPostion = $el.position().top;
155
156        if (currentRowStart != topPostion) {
157            for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) {
158                rowDivs[currentDiv].height(currentTallest);
159            }
160            rowDivs.length = 0; // empty the array
161            currentRowStart = topPostion;
162            currentTallest = $el.height();
163            rowDivs.push($el);
164        } else {
165            rowDivs.push($el);
166            currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest);
167        }
168        for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) {
169            rowDivs[currentDiv].height(currentTallest);
170        }
171    });
172}
173
174$(window).load(function() {
175    equalheight('.cover .hbox');
176});
177
178$(window).resize(function() {
179    equalheight('.cover .hbox');
180});
181
182$(window).load(function() {
183    equalheight('.cover1 .hbox1');
184});
185
186$(window).resize(function() {
187    equalheight('.cover1 .hbox1');
188});
189
190
191$(window).load(function() {
192    equalheight('.cover2 .hbox2');
193});
194
195$(window).resize(function() {
196    equalheight('.cover2 .hbox2');
197});
198
199
200
201///
202
203$(document).ready(function() {
204
205    if (header_height > 767) {
206        var header_height = $('#longswood-navbar').height();
207        $('#main-center-part').css("margin-top", header_height + "px")
208        $(window).on('resize', function() {
209            var header_height = $('#longswood-navbar').height();
210            $('#main-center-part').css("margin-top", header_height + "px")
211        });
212    }
213});
214
215
216
217
218
219// Custom Scroll
220
221(function($) {
222    $(window).on("load", function() {
223        $("#content-1").mCustomScrollbar({
224            theme: "minimal"
225        });
226    });
227})(jQuery);
228
229
230//JS for Shoping Cart Increase decrese number Plugin
231
232$(document).on('click', '.number-spinner button', function() {
233    var btn = $(this),
234        oldValue = btn.closest('.number-spinner').find('input').val().trim(),
235        newVal = 0;
236
237    if (btn.attr('data-dir') == 'up') {
238        newVal = parseInt(oldValue) + 1;
239    } else {
240        if (oldValue > 1) {
241            newVal = parseInt(oldValue) - 1;
242        } else {
243            newVal = 1;
244        }
245    }
246    btn.closest('.number-spinner').find('input').val(newVal);
247});
248
249
250$(document).ready(function() {
251    /*$(".dropdown").click(
252        function() {
253            $('.dropdown-menu', this).not('.in .dropdown-menu').stop(true, true).slideDown("fast");
254            $(this).toggleClass('open');
255        },
256        function() {
257            $('.dropdown-menu', this).not('.in .dropdown-menu').stop(true, true).slideUp("fast");
258            $(this).toggleClass('open');
259        }
260    );*/
261    
262    $('.dropdown').click(function() {
263      var state = $('> .sub-menu', this).hasClass('show');
264      $('#demo .dropdown .sub-menu').removeClass('show');
265      $('> .sub-menu', this).toggleClass('show', !state);
266    });
267    
268   $(".list-unstyled li").click(function(){
269        var state = $(this).hasClass('active');
270      $('.list-unstyled li').removeClass('active');
271      $(this).toggleClass('active', !state);     
272   });
273
274
275    //*Menu css mobile*/
276       
277    $('#sidebarCollapse').on('click', function() {
278        $('#sidebar').toggleClass('active');
279        $('#demo .dropdown .sub-menu').removeClass('show');
280    });
281    // js add by sj
282    $('#sidebarCollapse1').on('click', function() {       
283        $('#sidebar').toggleClass('active');
284        $('#demo .dropdown .sub-menu').removeClass('show');
285    });
286    // js add by sj
287    // $('.left_social_icon').on('click', function() {
288    //     if ($(window).width() > 991) {
289    //         $('#sidebar').toggleClass('active');
290    //     }
291    // });
292});
293
294
295$(document).ready(function() {
296    var header_height = $('header').height();
297    $('.mymenu').css("top", (header_height - 50))
298    $(window).on('resize', function() {
299        var header_height = $('header').height();
300        $('.mymenu').css("top", (header_height - 50))
301    });
302});
303
304
305
306//For mobile left nav JS
307
308function myaffix() {
309
310    var affixoffset = $('.nav.nav-pills').offset().top
311
312    $('.wrapper').height($(".nav.nav-pills").height());
313
314
315    if ($(window).width() < 991) {
316
317        $(window).scroll(function() {
318            if ($(window).scrollTop() <= affixoffset) {
319                $('.nav.nav-pills').removeClass('affix');
320            } else {
321                $('.nav.nav-pills').addClass('affix');
322            }
323        });
324
325    } else {
326        /* NEED TO DEFINE SOMETHING IN ELSE CONDITION */
327    }
328};
329
330$(document).ready(function() {
331
332    myaffix();
333
334    $(window).on("resize", function() {
335        myaffix();
336    });
337
338});
339
340$('#sidebar.active .coll-share').on('click', function() {
341    $('#sidebar').toggleClass('active');
342});
343
344$('.close_nav_only_mbl').on('click', function() {
345    $('#sidebar').removeClass('active');
346});
347
348
349$(document).ready(function() {
350    var header_height = $('#top_picks').height();
351    $(window).on('resize', function() {
352        var header_height = $('#top_picks').height();
353    });
354    $("#right-side-add-home-page").css("top", (header_height + 20));
355
356    //New Js for new left navigation changes @SA on 22th Jan 2018
357    $(" #sidebar.active .dropdown-menu").css("padding-bottom", (header_height - 100));
358    $(".video_player_cls > iframe").height($("#myCarousel").height());    
359});
360$( window ).resize(function() {
361        $(".video_player_cls > iframe").height($("#myCarousel").height());
362});
363/*$('#sidebar .list-unstyled').hover(function(e) {
364    $('#sidebar').removeClass('active');
365});*/
366
367
368//For Socail Icons
369
370// $(".coll-share").hover(function() {
371//     $(".footer_social_icons").addClass("intro");
372// });
373
374// $(".footer_social_icons").mouseout(function() {
375//     $(this).removeClass("intro");
376// });
377
378// $(".footer_social_icons").hover(function() {
379//     $(".footer_social_icons").addClass("intro");
380// });
381
382
383
384
385// $(".close_social").click(function() {
386//     $(".footer_social_icons").removeClass("intro");
387// });
388
389
390 /* Check width on page load*/  
391
392
393       /*$(document.body).click(function(){
394          $('.dropdown .sub-menu').removeClass('show');
395            $('#sidebar').addClass('active');
396       });
397
398       $("#sidebar").click(function(e){
399           e.stopPropagation(); 
400       });
401       $("#sidebarCollapse1").click(function(e){
402           e.stopPropagation(); 
403       });*/
404
405if ($(window).width() < 991) {
406       $(document.body).click(function(){
407          $('.dropdown .sub-menu').removeClass('show');
408            $('#sidebar').removeClass('active');
409       });
410
411       $("#sidebar").click(function(e){
412           e.stopPropagation(); 
413       });
414       $("#sidebarCollapse1").click(function(e){
415           e.stopPropagation(); 
416       });
417         
418
419} else {
420      $(document.body).click(function(){
421          $('.dropdown .sub-menu').removeClass('show');
422            $('#sidebar').addClass('active');
423       });
424
425       $("#sidebar").click(function(e){
426           e.stopPropagation(); 
427       });
428       $("#sidebarCollapse1").click(function(e){
429           e.stopPropagation(); 
430       });       
431   
432}
433
434
435
436/* When the user clicks on the button, 
437toggle between hiding and showing the dropdown content */
438function myFunction() {
439    document.getElementById("myDropdown").classList.toggle("show");
440}
441
442// Close the dropdown if the user clicks outside of it
443window.onclick = function(event) {
444  if (!event.target.matches('.dropbtn')) {
445
446    var dropdowns = document.getElementsByClassName("dropdown-content");
447    var i;
448    for (i = 0; i < dropdowns.length; i++) {
449      var openDropdown = dropdowns[i];
450      if (openDropdown.classList.contains('show')) {
451        openDropdown.classList.remove('show');
452      }
453    }
454  }
455}

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.