PageSourceSearch

https://safalawaj.com/wp-content/themes/safalawaj/js/scripts.js

js safalawaj.com collected 2026-10-03 00:40:39 UTC 6,059 bytes, 251 lines download raw bytes

1jQuery(document).ready(function($){
2	$window = $(window);
3	$document = $(document);
4
5	//declare useful variables here ------------------------------------------------
6	var document_width = $document.width();
7	var document_height = $document.height();
8	var $header = $('header');
9	var $main_url = $('body').attr('data-url');
10	var $cur_permalink = $('body').attr('data-permalink');
11	var $branding_menu = $('#branding-menu');
12
13	$('#breaking-news-slider').show();
14	
15
16	// main-menu-----------------------------
17	$('#main-menu .sub-menu').hide();
18	$('#main-menu li, .top-menu li').hover(function(){
19		$('.sub-menu', this).first().show();
20		// console.log('hover');
21		$(this).addClass('active');
22	}, function(){
23		// console.log('hover out');
24		$('.sub-menu', this).hide();
25		$(this).removeClass('active');
26	});
27
28	// $('#mobile-menu .sub-menu').addClass('dropdown-menu');
29
30	$(document).scroll(function(){
31		scrolled = $(document).scrollTop();
32
33		if(scrolled > 100){
34			$('#main-menu').addClass('fixed');
35		}
36		else{
37			$('#main-menu').removeClass('fixed');
38		}
39	})
40
41
42	//search ----------------------------
43
44	$('#searchsubmit, #search-input').hover(function(){
45		$('#searchform').addClass('active');
46	}, function(){
47		$('#searchform').removeClass('active');
48	});
49
50
51
52	//breaking news slider
53	$('.bn-slider, .featured-news-slider').flexslider({
54		animation: "slide",
55		controlNav: false,
56		pauseOnHover: true,
57		// slideshow: false,
58		prevText: '<i class="glyphicon glyphicon-menu-left"></i>',
59		nextText: '<i class="glyphicon glyphicon-menu-right"></i>',
60		smoothHeight: true,
61		
62	});
63
64
65
66	$('.sr-slider').flexslider({
67		animation: "slide",
68		controlNav: false,
69		itemWidth: 300,
70		pauseOnHover: true,
71		// slideshow: false,
72		prevText: '<i class="fa fa-angle-left"></i>',
73		nextText: '<i class="fa fa-angle-right"></i>',
74		
75	});
76
77
78	//tabs -------------------------------------------
79
80	var $tabs_li = $('.classic-tabs ul li');
81	var total_tabs = $tabs_li.length;
82	$tabs_li.css('width', (100/total_tabs)+'%');
83
84
85	//jueryui tabs
86	$(function() {
87		$( ".classic-tabs" ).tabs();
88	});
89
90
91
92	var $single_content = $('.single-content');
93
94	//remove default styles
95	$single_content.find('style').remove();
96	$single_content.find('img').addClass('img-responsive');
97	$single_content.find('.gallery br').remove();
98	$single_content.find('.gallery').prepend('<h4 class="col-xs-12">फोटो ग्यालरी</h4>');
99	$single_content.find('.gallery-item').each(function(){
100		$(this).addClass('col-xs-6 col-sm-4 col-md-3 col-lg-2').find('img').addClass('img-responsive img-thumbnail');
101	})
102
103	//fancy box ------------------------------------------------
104
105	$('.single-content .gallery a').attr('rel', 'fancybox-thumb fancybox-button').addClass('fancybox-thumb fancybox-button');
106
107	$(".fancybox-thumb").fancybox({
108		padding: [5, 5, 5, 5],
109		margin: [40, 20, 20, 20],
110
111		prevEffect  : 'none',
112		nextEffect  : 'none',
113		helpers : {
114			title : {
115				type: 'inside'
116			},
117			thumbs  : {
118				width : 50,
119				height  : 50
120			}
121		}
122	});
123
124
125	$('.fancybox-media').fancybox({
126		padding:5,
127		openEffect  : 'none',
128		closeEffect : 'none',
129		helpers : {
130			media : {}
131		}
132	});
133
134
135
136	//english to nepali number
137	function nepaliNum(num){
138	
139		num = num.toString(); 	
140
141		nep_num = '';
142		for (var i = 0; i < num.length; i++) {
143
144			switch(num.charAt(i)){
145				case '0':
146			        nep_num += "०";
147			        break;
148			    case '1':
149			        nep_num +=  "१";
150			        break;
151			    case '2':
152			        nep_num +=  "२";
153			        break;
154			    case '3':
155			        nep_num +=  "३";
156			        break;
157			    case '4':
158			        nep_num +=  "४";
159			        break;
160			    case '5':
161			        nep_num +=  "५";
162			        break;
163			    case '6':
164			        nep_num +=  "६";
165			        break;
166			    case '7':
167			        nep_num +=  "७";
168			        break;
169			    case '8':
170			        nep_num +=  "८";
171			        break;
172			    case '9':
173			        nep_num +=  "९";
174			        break;
175			    default :
176			        nep_num =  num;
177			        break;
178			}
179		}
180
181		return nep_num;
182	}
183
184	var $paginate = $('.wp-pagenavi');
185	$paginate.find('span, a').each(function(){
186		val = $(this).html();
187
188		if(val == '...'){
189			$(this).hide();
190		}
191
192		$(this).html( nepaliNum(val) );			
193		
194	})
195
196
197	//
198	var $featured_full = $('#featured-full');
199	var $featured_news = $('.home-top-content .home-featured-news');
200
201	move_featured_news();
202	
203	function move_featured_news(){
204		if(document_width < 992){
205			$featured_full.html($featured_news.html()).show();
206			$featured_news.hide();		
207			// alert('down');
208		}
209		else{
210			// alert('up');
211			$featured_news.show();
212			$featured_full.hide();
213		}
214
215		// console.log(document_width);
216
217	}
218
219
220	$(window).resize(function(){
221		document_width = $document.width();
222		move_featured_news();
223	});
224
225
226	//remove visual editor css
227	// $('*').removeClass('vc_col-lg-1 vc_col-lg-10 vc_col-lg-11 vc_col-lg-12 vc_col-lg-2 vc_col-lg-3 vc_col-lg-4 vc_col-lg-5 vc_col
227-lg-6 vc_col-lg-7 vc_col-lg-8 vc_col-lg-9 vc_col-md-1 vc_col-md-10 vc_col-md-11 vc_col-md-12 vc_col-md-2 vc_col-md-3 vc_col-md-4 vc_col-md-5 vc_col-md-6 vc_col-md-7 vc_col-md-8 vc_col-md-9 vc_col-sm-1 vc_col-sm-10 vc_col-sm-11 vc_col-sm-12 vc_col-sm-2 vc_col-sm-3 vc_col-sm-4 vc_col-sm-5 vc_col-sm-6 vc_col-sm-7 vc_col-sm-8 vc_col-sm-9 vc_col-xs-1 vc_col-xs-10 vc_col-xs-11 vc_col-xs-12 vc_col-xs-2 vc_col-xs-3 vc_col-xs-4 vc_col-xs-5 vc_col-xs-6 vc_col-xs-7 vc_col-xs-8 vc_col-xs-9 vc_row wpb_row vc_inner vc_row-fluid wpb_wrapper wpb_column vc_column_container');
228
229
230
231	
232
233	// $(function() {
234	// 	$( "tabs, .side-menu-tabs" ).tabs({
235	// 		beforeLoad: function( event, ui ) {
236	// 			ui.jqXHR.fail(function() {
237	// 				ui.panel.html(
238	// 					"Couldn't load this tab. We'll try to fix this as soon as possible. ");
239	// 			});
240	// 		}
241	// 	});
242	// });
243
244	
245
246
247}); //dont delete this
248
249
250
251

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.