PageSourceSearch

https://www.bellanaijastyle.com/wp-content/themes/broden/js/custom-app.js

js bellanaijastyle.com collected 2026-10-02 05:08:05 UTC 12,924 bytes, 516 lines download raw bytes

1
2jQuery(document).ready(function ($) {
3	"use strict";
4
5	/*====== PRELOADER ======*/
6	jQuery(window).load(function() {
7	        // will first fade out the loading animation
8		jQuery(".lines").fadeOut();
9	        // will fade out the whole DIV that covers the website.
10		jQuery(".preloader").delay(1000).fadeOut("slow");
11	});
12	/*====== MOBILE MENU SEPERATOR ======*/
13	$('ul.mobile-menu li.menu-item-has-children').append('<span><i class="fa fa-caret-down" aria-hidden="true"></i></span>');
14
15	/*====== SIDEBAR ======*/
16	$('.sidebar-navigation').each(function(){
17		$("body").on("click",".sidebar-button a", function(e){
18	    	$("html").addClass("sidebar-nav-open");
19	    	$(".sidebar-navigation, .blog-inwrap").addClass("open");
20
21			e.stopPropagation();
22	    	e.preventDefault();
23	    });
24
25	    $("body").on("click",".close-btn", function(e){
26			$("html").removeClass("sidebar-nav-open");
27			$(".sidebar-navigation, .blog-inwrap").removeClass("open");
28
29	    	e.preventDefault();
30	    });
31
32	    var clone_sidebar_logo = $("header .brand-logo").clone();
33	    var clone_sidebar_social = $("header .social-button .social-links ul").clone();
34	    var clone_sidebar_copyright = $("footer .copyright p").clone();
35
36	    $(".sidebar-navigation-logo").append(clone_sidebar_logo);
37	    $(".sidebar-navigation-social").append(clone_sidebar_social);
38	    $(".sidebar-navigation-copyright").append(clone_sidebar_copyright);
39
40		$(".sidebar-navigation ul li.menu-item-has-children span").on("click", function() {
41			var link = $(this);
42			var closest_ul = link.closest("ul");
43			var parallel_active_links = closest_ul.find(".active")
44			var closest_li = link.closest("li");
45			var link_status = closest_li.hasClass("active");
46			var count = 0;
47
48			closest_ul.find("ul").slideUp(function() {
49				if (++count == closest_ul.find("ul").length)
50						parallel_active_links.removeClass("active");
51			});
52
53			if (!link_status) {
54				closest_li.children("ul").slideDown();
55				closest_li.addClass("active");
56			}
57		});
58
59		$('.scrollbar-macosx').scrollbar();
60
61	});
62
63	/*====== SOCIAL MEDIA ======*/
64	$('header .social-button').each(function(){
65		$('header .header-main .social-button ul').each(function(){
66		    var liItems = $(this);
67		    var Sum = 0;
68		    if(liItems.children('li').length >= 1){
69		        $(this).children('li').each(function(i, e){
70		            Sum += $(e).outerWidth(true);
71		        });
72		        $(this).width(Sum+1);
73		    }
74		});
75		$('header .header-main .social-button .social-toggle').on('click', function () {
76        	$('header .header-main .social-links, header .header-main .social-toggle').toggleClass('active');
77    	});
78
79		$('header.style-2 .header-bottom .social-button ul').each(function(){
80		    var liItems = $(this);
81		    var Sum = 0;
82		    if(liItems.children('li').length >= 1){
83		        $(this).children('li').each(function(i, e){
84		            Sum += $(e).outerWidth(true);
85		        });
86		        $(this).width(Sum+1);
87		    }
88		});
89		$('header.style-2 .header-bottom .social-button .social-toggle').on('click', function () {
90        	$('header.style-2 .header-bottom .social-links, header.style-2 .header-bottom .social-toggle').toggleClass('active');
91    	});
92	});
93
94	/*====== MOBILE TOPBAR ======*/
95	$('.search-for-mobile').each(function(){
96		$('.search-for-mobile .mobile-search a').on('click', function () {
97        	$('.search-for-mobile .mobile-search').toggleClass('open');
98    	});
99	});
100
101	/*====== STICKY NAVBAR ======*/
102	$('.header-bottom').each(function(){
103		var window_scrolltop;
104		var clone_navigation = $(".header-bottom").clone().addClass("sticky");
105		var clone_fixed_logo = $("header .brand-logo").clone();
106		var clone_fixed_search = $("header .header-main .search-button").clone();
107		var clone_fixed_social = $("header .header-main .social-button").clone();
108
109		if($("#wpadminbar").length>0){
110			$("body").addClass("wpadminbar-open");
111		}
112
113		$("header").append(clone_navigation);
114		$(".header-bottom.sticky").append(clone_fixed_logo);
115		$(".header-bottom.sticky").append(clone_fixed_search);
116		$(".header-bottom.sticky").append(clone_fixed_social);
117
118
119		$(window).scroll(function(){
120			window_scrolltop = $(this).scrollTop();
121			if(window_scrolltop>500){
122				$(".header-bottom.sticky").addClass("open");
123			}
124			else {
125				$(".header-bottom.sticky").removeClass("open");
126			}
127		});
128
129		$('header .header-bottom.sticky .social-button .social-toggle').on('click', function () {
130        	$('header .header-bottom.sticky .social-links, header .header-bottom.sticky .social-toggle').toggleClass('active');
131    	});
132
133	});
134
135
136	/*====== BLOG FEATURED ======*/
137
138		// $('.featured-style-1').slick({
139		//   dots: false,
140		//   arrows: true,
141		//   autoplay: true,
142		//   speed: 300,
143		//   slidesToShow: 4,
144		//   slidesToScroll: 1,
145		//   responsive: [
146		//     {
147		//       breakpoint: 1024,
148		//       settings: {
149		//         slidesToShow: 3,
150		//         slidesToScroll: 3,
151		// 	    dots: false
152		//       }
153		//     },
154		//     {
155		//       breakpoint: 767,
156		//       settings: {
157		//         slidesToShow: 2,
158		// 	    dots: false,
159		//         slidesToScroll: 2
160		//       }
161		//     },
162		//     {
163		//       breakpoint: 666,
164		//       settings: {
165		//         slidesToShow: 1,
166		// 	    dots: false,
167		//         slidesToScroll: 1
168		//       }
169		//     }
170		//   ]
171		// });
172		//
173		// $('.featured-style-2').slick({
174		//   dots: true,
175		//   arrows: true,
176		//   infinite: true,
177		//   autoplay: true,
178		//   speed: 300,
179		//   slidesToShow: 3,
180		//   slidesToScroll: 1,
181		//   responsive: [
182		//     {
183		//       breakpoint: 1024,
184		//       settings: {
185		//         slidesToShow: 3,
186		//         slidesToScroll: 1,
187		//         infinite: true,
188		//         dots: true
189		//       }
190		//     },
191		//     {
192		//       breakpoint: 767,
193		//       settings: {
194		//         slidesToShow: 2,
195		//         slidesToScroll: 1
196		//       }
197		//     },
198		//     {
199		//       breakpoint: 666,
200		//       settings: {
201		//         slidesToShow: 1,
202		//         slidesToScroll: 1
203		//       }
204		//     }
205		//   ]
206		// });
207		//
208		// $('.featured-style-3 .featured-style-width').slick({
209		//   dots: false,
210		//   arrows: true,
211		//   infinite: true,
212		//   autoplay: true,
213		//   speed: 300,
214		//   slidesToShow: 1,
215		//   slidesToScroll: 1,
216		// });
217		//
218		// $('.featured-style-4').slick({
219		//   dots: true,
220		//   arrows: true,
221		//   infinite: true,
222		//   autoplay: true,
223		//   centerMode: true,
224		//   centerPadding: '80px',
225		//   speed: 1200,
226		//   slidesToShow: 2,
227		//   slidesToScroll: 1,
228		//   autoplaySpeed: 3500,
229		//   responsive: [
230		//     {
231		//       breakpoint: 1024,
232		//       settings: {
233		//         slidesToShow: 2,
234		//         slidesToScroll: 1,
235		//         centerPadding: '0px',
236		//         infinite: true,
237		//         dots: true
238		//       }
239		//     },
240		//     {
241		//       breakpoint: 767,
242		//       settings: {
243		//         slidesToShow: 2,
244		//         centerPadding: '0px',
245		//         slidesToScroll: 1
246		//       }
247		//     },
248		//     {
249		//       breakpoint: 666,
250		//       settings: {
251		//         slidesToShow: 1,
252		//         centerPadding: '0px',
253		//         slidesToScroll: 1
254		//       }
255		//     }
256		//   ]
257		// });
258
259
260
261	/*====== CATEGORY POST SLIDER ======*/
262	$('.category-posts').each(function(){
263
264		$('.category-slider').slick({
265		  dots: true,
266		  arrows: false,
267		  infinite: true,
268		  autoplay: true,
269		  speed: 300,
270		  slidesToShow: 1,
271		  slidesToScroll: 1
272		});
273
274	});
275
276	/*====== CATEGORY POST SLIDER WIDGET ======*/
277	$('.category-widget-slider ul').slick({
278	    dots: true,
279		arrows: false,
280		infinite: true,
281		autoplay: true,
282		speed: 300,
283		slidesToShow: 1,
284		slidesToScroll: 1
285	});
286
287
288	/*====== CATEGORY ARTICLES ======*/
289	$('.theme-category-articles').each(function(){
290
291		$('.theme-category-articles-style-1').slick({
292		  dots: false,
293		  arrows: false,
294		  infinite: true,
295		  autoplay: true,
296		  speed: 300,
297		  slidesToShow: 8,
298		  slidesToScroll: 1,
299		  responsive: [
300		    {
301		      breakpoint: 1024,
302		      settings: {
303		        slidesToShow: 4,
304		        slidesToScroll: 1,
305		        infinite: true,
306		        dots: true
307		      }
308		    },
309		    {
310		      breakpoint: 767,
311		      settings: {
312		        slidesToShow: 2,
313		        slidesToScroll: 1
314		      }
315		    },
316		    {
317		      breakpoint: 666,
318		      settings: {
319		        slidesToShow: 1,
320		        slidesToScroll: 1
321		      }
322		    }
323		  ]
324		});
325
326		$('.theme-category-articles-style-2').slick({
327		  dots: false,
328		  arrows: true,
329		  fade: true,
330		  infinite: true,
331		  autoplay: true,
332		  speed: 300,
333		  slidesToShow: 1,
334		  slidesToScroll: 1,
335		});
336
337	});
338
339
340
341	/*====== STICKY SIDEBAR ======*/
342	$('.sidebar').each(function(){
343		$('.sidebar').theiaStickySidebar({
344			additionalMarginTop: 70,
345			additionalMarginBottom: 30,
346		});
347	});
348
349	/*====== POST TYPE VIDEO ======*/
350	$('.post-video').each(function(){
351		$(".post-video").fitVids();
352	});
353
354	/*====== POST TYPE GALLERY ======*/
355	$('.post-gallery').each(function(){
356		$(".post-gallery").justifiedGallery({
357			rowHeight: 200,
358			margins: 1,
359			lastRow: 'justify',
360			captions : false,
361		});
362		$(".post-full-image .post-gallery").justifiedGallery({
363			rowHeight: 270,
364			margins: 1,
365			lastRow: 'justify',
366			captions : false,
367		});
368	});
369
370	/*====== LIGHTBOX IMAGE ======*/
371	$('a.lightbox-image').each(function(){
372		$('a.lightbox-image').magnificPopup({
373			type:'image',
374			gallery:{
375				enabled:true
376			}
377	  	});
378  	});
379
380	/*====== POST TYPE GRID FIXED HEIGH  ======*/
381	$('.grid-style').each(function(){
382		var $list		= $( '.blog-posts' ),
383			$items		= $list.find( '.grid-style' ),
384			setHeights	= function()
385		    {
386				$items.css( 'height', 'auto' );
387
388				var perRow = Math.floor( $list.width() / $items.width() );
389				if( perRow == null || perRow < 2 ) return true;
390
391				for( var i = 0, j = $items.length; i < j; i += perRow )
392				{
393					var maxHeight	= 0,
394						$row		= $items.slice( i, i + perRow );
395
396					$row.each( function()
397					{
398						var itemHeight = parseInt( $( this ).outerHeight(), 10 );
399						if ( itemHeight > maxHeight ) maxHeight = itemHeight;
400					});
401					$row.css( 'height', maxHeight );
402				}
403			};
404
405
406		setHeights();
407		$( window ).on( 'resize', setHeights );
408		$list.find( 'img' ).on( 'load', setHeights );
409	});
410
411	/*====== COMMENT POST TOGLLE ======*/
412	$('.post-comments .comments-title').each(function(){
413		var $content = $(".comment-list");
414		$(".post-comments .comments-title a").on("click", function(e){
415			$(this).toggleClass("expanded");
416			$content.slideToggle();
417		});
418	});
419
420
421	/*====== MEGA MENU ======*/
422	function mousein_triger(){
423		var fullsize = $('.wrapper').width();
424		if (fullsize > 700) {
425		$(".main-menu .menu-item").removeClass("active");
426		$(this).addClass("active");
427		$(this).find('.mega-menu-wrapper').css('visibility', 'hidden').show();
428		$(this).find('.mega-menu-wrapper').height($(this).find('.mega-category').height());
429		$(this).find('.mega-menu-wrapper').css('visibility', 'visible').hide();
430		$(this).children('.mega-menu-wrapper, .sub-meni').fadeIn(150);
431
432  		}
433	}
434
435	function mouseout_triger() {
436        $(this).children('.mega-menu-wrapper, .sub-meni').fadeOut(150);
437	}
438	var settings = {
439		sensitivity: 4,
440		interval: 30,
441		timeout: 300,
442		over: mousein_triger,
443		out:mouseout_triger
444
445	};
446
447	$('.main-menu .menu-item').not( '.sub-menu .menu-item' ).hoverIntent( settings );
448
449    var settings1 = {
450        sensitivity: 4,
451        interval: 0,
452        timeout: 300,
453        over: mousein_triger,
454        out:mouseout_triger
455
456	};
457
458	$( '.sub-menu .menu-item' ).hoverIntent( settings1 );
459
460	/*====== BACK TO TOP ======*/
461	$('.back-to-top').each(function(){
462		var offset = 220;
463		var duration = 500;
464			$(window).scroll(function() {
465				if ($(this).scrollTop() > offset) {
466					$('.back-to-top').fadeIn(duration);
467				} else {
468					$('.back-to-top').fadeOut(duration);
469				}
470		});
471
472		$('.back-to-top a').on("click", function(event) {
473
474			event.preventDefault();
475			$('html, body').animate({scrollTop: 0}, 1000);
476
477		return false;
478		});
479	});
480
481    ////////////////////////////////////////////////////////////////////////////////////
482
483	// $('.trending-lists').css('visibility', 'visible');
484	//
485    // $('.trending-lists ul').slick({
486    //     dots: false,
487	// 	infinite: false,
488    //     arrows: true,
489    //     autoplay: false,
490    //     speed: 300,
491    //     variableWidth: true,
492    //     slidesToShow: 8,
493    //     slidesToScroll: 3,
494    //     responsive: [
495    //         {
496    //             breakpoint: 1024,
497    //             settings: {
498    //                 slidesToShow: 5
499    //             }
500    //         },
501    //         {
502    //             breakpoint: 767,
503    //             settings: {
504    //                 slidesToShow: 3
505    //             }
506    //         },
507    //         {
508    //             breakpoint: 666,
509    //             settings: {
510    //                 slidesToShow: 2
511    //             }
512    //         }
513    //     ]
514    // });
515
516});

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.