PageSourceSearch

https://www.allindiabarexamination.com/js/functions.js

js allindiabarexamination.com collected 2026-10-02 17:17:51 UTC 14,355 bytes, 446 lines download raw bytes

1/*
2	Project Name : Knowledge
3	
4	-- Google Map
5	
6	## Document Scroll
7		
8	## Document Ready
9		-- Scrolling Navigation
10		-- Find all anchors
11		-- Add Easing Effect
12		-- Responsive Caret	
13		-- Remove p empty tag for Shortcode
14		-- Expanding Search
15		-- PhotoSlider Section:: Text Effect
16		-- Welcome Section
17		-- Parallax Carousel
18		-- Event Section
19		-- Event Block
20		-- SearchCourses
21		-- Video Testimonial Section
22		-- Latest Blog Section
23		-- Team Section
24		-- CallOut
25		-- Video Block
26		-- CourseDetail Section
27		-- WhyChooseUs Section
28		-- Blog
29		-- ContactUs Section
30		-- Testimonial 2 Section
31		-- Contact Map
32		-- Contact Form
33
34	## Window Load
35		-- Site Loader
36*/
37
38(function($) {
39
40	"use strict"
41	/* -- Google Map */
42	function initialize(obj) {
43		var lat = $('#'+obj).attr("data-lat");
44        var lng = $('#'+obj).attr("data-lng");
45		var contentString = $('#'+obj).attr("data-string");
46		var myLatlng = new google.maps.LatLng(lat,lng);
47		var map, marker, infowindow;
48		var image = "images/marker.png";
49		var zoomLevel = parseInt($('#'+obj).attr("data-zoom") ,10);
50		var styles = [{"featureType":"landscape","stylers":[{"saturation":-100},{"lightness":65},{"visibility":"on"}]},{"featureType":"poi","stylers":[{"saturation":-100},{"lightness":51},{"visibility":"simplified"}]},{"featureType":"road.highway","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"road.arterial","stylers":[{"saturation":-100},{"lightness":30},{"visibility":"on"}]},{"featureType":"road.local","stylers":[{"saturation":-100},{"lightness":40},{"visibility":"on"}]},{"featureType":"transit","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"administrative.province","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels","stylers":[{"visibility":"on"},{"lightness":-25},{"saturation":-100}]},{"featureType":"water","elementType":"geometry","stylers":[{"hue":"#ffff00"},{"lightness":-25},{"saturation":-97}]}]
51		var styledMap = new google.maps.StyledMapType(styles,{name: "Styled Map"});	
52		
53		var mapOptions = {
54			zoom: zoomLevel,
55			disableDefaultUI: true,
56			center: myLatlng,
57            scrollwheel: false,
58			mapTypeControlOptions: {
59            mapTypeIds: [google.maps.MapTypeId.ROADMAP, "map_style"]
60			}
61		}		
62		map = new google.maps.Map(document.getElementById(obj), mapOptions);
63		map.mapTypes.set("map_style", styledMap);
64		map.setMapTypeId("map_style");
65		
66		infowindow = new google.maps.InfoWindow({
67			content: contentString
68		});      
69	    
70        marker = new google.maps.Marker({
71			position: myLatlng,
72			map: map,
73			icon: image
74		});
75
76		google.maps.event.addListener(marker, "click", function() {
77			infowindow.open(map,marker);
78		});	
79	}
80	
81	/* ## Document Scroll - Window Scroll */
82	$( document ).scroll(function()
83	{
84		var scroll	=	$(window).scrollTop();
85		var height	=	$(window).height();
86
87		/*** set sticky menu ***/
88		if( scroll >= height )
89		{
90			$(".menu-block").addClass("navbar-fixed-top animated fadeInDown").delay( 2000 ).fadeIn();
91		}
92		else if ( scroll <= height )
93		{
94			$(".menu-block").removeClass("navbar-fixed-top animated fadeInDown");
95		}
96		else
97		{
98			$(".menu-block").removeClass("navbar-fixed-top animated fadeInDown");
99		} 
100
101		if ($(this).scrollTop() >= 50)
102		{	
103			/* If page is scrolled more than 50px */
104			$("#back-to-top").fadeIn(200); /* Fade in the arrow */
105		}
106		else
107		{
108			$("#back-to-top").fadeOut(200); /* Else fade out the arrow */
109		}
110	});
111		
112	/* ## Document Ready - Handler for .ready() called */
113	$(document).ready(function($) {
114		/* -- Scrolling Navigation */
115		var scroll	=	$(window).scrollTop();
116		var width	=	$(window).width();
117		var height	=	$(window).height();
118		
119		/*** set sticky menu ***/
120		if( scroll >= height -500 )
121		{
122			$(".menu-block").addClass("navbar-fixed-top").delay( 2000 ).fadeIn();
123		}
124		else if ( scroll <= height )
125		{
126			$(".menu-block").removeClass("navbar-fixed-top");
127		}
128		else
129		{
130			$(".menu-block").removeClass("navbar-fixed-top");
131		} /* set sticky menu - end */
132		
133		/* local url of page (minus any hash, but including any potential query string) */
134		var url = location.href.replace(/#.*/,'');
135
136		/* -- Find all anchors */
137		$("#navbar").find("a[href]").each(function(i,a) {
138
139			var $a = $(a);
140			var href = $a.attr("href");
141
142			/* check is anchor href starts with page's URI */
143			if ( href.indexOf(url+'#') == 0 ) {
144
145				/* remove URI from href */
146				href = href.replace(url,'');
147
148				/* update anchors HREF with new one */
149				$a.attr("href",href);
150			}
151		});
152
153		/* -- Add Easing Effect on Section Scroll */
154		$('.navbar-nav li a[href*=#]:not([href=#]), .site-logo a[href*=#]:not([href=#])').on('click', function() {
155
156		   if ( location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname ) {
157				var target = $(this.hash);
158				target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
159
160				if (target.length) {
161					$('html, body').animate( { scrollTop: target.offset().top - 83 }, 1000, 'easeInOutExpo' );
162					return false;
163				}
164			}
165		});	
166		
167		/* -- Responsive Caret */
168		$(".ddl-switch").on("click", function() {
169
170			var li = $(this).parent();
171			if ( li.hasClass("ddl-active") || li.find(".ddl-active").length !== 0 || li.find(".dropdown-menu").is(":visible") ) {
172				li.removeClass("ddl-active");
173				li.children().find(".ddl-active").removeClass("ddl-active");
174				li.children(".dropdown-menu").slideUp();
175			}
176			else {
177				li.addClass("ddl-active");
178				li.children(".dropdown-menu").slideDown();
179			}
180		});
181		
182		/* -- Remove p empty tag for Shortcode */
183		$( "p" ).each(function() {
184			var $this = $( this );
185				if( $this.html().replace(/\s|&nbsp;/g, '').length == 0) {
186				$this.remove();
187			}
188		});
189		
190		/* -- Expanding Search */
191		new UISearch( document.getElementById( "sb-search" ) );
192		
193		/* -- PhotoSlider Section:: Text Effect */
194		function doAnimations( elems ) {
195			/* Cache the animationend event in a variable */
196			var animEndEv = 'webkitAnimationEnd animationend';
197
198				elems.each(function () {
199				var $this = $(this),
200					$animationType = $this.data('animation');
201					$this.addClass($animationType).one(animEndEv, function () {
202					$this.removeClass($animationType);
203				});
204			});
205		}
206		var $myCarousel = $('#home-slider'),
207		$firstAnimatingElems = $myCarousel.find('.item:first').find("[data-animation ^= 'animated']");
208		$myCarousel.carousel();
209		doAnimations($firstAnimatingElems);
210		$myCarousel.carousel('pause');
211		$myCarousel.on('slide.bs.carousel', function (e) {
212			var $animatingElems = $(e.relatedTarget).find("[data-animation ^= 'animated']");
213			doAnimations($animatingElems);
214		});
215		
216		
217		/* -- Welcome Section  */
218		if( $(".welcome-section").length ) {
219			$(".welcome-section").each(function () {
220				var $this = $(this);
221				var myVal = $(this).data("value");
222				$this.appear(function() {
223					$(".welcome-box").addClass( "animated fadeInRight" );
224				});
225			});
226		}
227		
228		/* -- Parallax Carousel */
229		 if( $(".parallax-section").length ) {
230			$(".parallax-carousel").owlCarousel({
231				loop: true,
232				autoplay: false,
233				items: 1,
234				nav: false,
235				dots: true,
236				mouseDrag: false,
237				autoplayHoverPause: true,
238				animateOut: "slideOutUp",
239				animateIn: "slideInUp"
240			})
241			
242			$(".parallax-section").each(function () {
243				var $this = $(this);
244				var myVal = $(this).data("value");
245				$this.appear(function() {
246					$(".parallax-section").addClass( "animated fadeInLeft" );
247				});
248			});
249		}
250		
251		/* -- Event Section  */
252		if( $(".event-section").length ) {
253			$(".event-section").each(function () {
254				var $this = $(this);
255				var myVal = $(this).data("value");
256				$this.appear(function() {
257					$(".event-section .event-block .event-box").addClass( "animated fadeInRight" );
258				});
259			});
260		}
261		
262		/* -- Latest Blog Section  */
263		if( $(".latestblog-section").length ) {
264			$(".latestblog-section").each(function () {
265				var $this = $(this);
266				var myVal = $(this).data("value");
267				$this.appear(function() {
268					$(".latestblog-section").addClass( "animated fadeInLeft" );
269				});
270			});
271		}
272		
273		/* -- Team Section  */
274		if( $(".team-section").length ) {
275			$(".team-section").each(function () {
276				var $this = $(this);
277				var myVal = $(this).data("value");
278				$this.appear(function() {
279					$(".team-section").addClass( "animated fadeInLeft" );
280				});
281			});
282		}
283		
284		/* -- Video Block */
285		if( $(".video-block").length ) {
286			$('.popup-youtube').magnificPopup({
287				disableOn: 700,
288				type: 'iframe',
289				mainClass: 'mfp-fade',
290				removalDelay: 160,
291				preloader: false,
292				fixedContentPos: false
293			});
294		}
295		
296		/* -- CourseDetail Section  */
297		if( $(".coursesdetail-section").length ) {
298			$(".coursesdetail-section").each(function () {
299				var $this = $(this);
300				var myVal = $(this).data("value");
301				$this.appear(function() {
302					$(".coursesdetail-section .event-contentarea").addClass( "animated fadeInLeft" );
303					$(".coursesdetail-section .event-sidebar").addClass( "animated fadeInRight" );
304				});
305			});
306		}
307		
308		/* -- WhyChooseUs Section  */
309		if( $(".whychooseus-section").length ) {
310			$(".whychooseus-section").each(function () {
311				var $this = $(this);
312				var myVal = $(this).data("value");
313				$this.appear(function() {
314					$(".whychooseus-section .video-block").addClass( "animated fadeInLeft" );
315					$(".whychooseus-section .accordion-section").addClass( "animated fadeInRight" );
316				});
317			});
318		}
319		
320		/* -- Blog  */
321		if( $(".blog").length ) {
322			$(".blog").each(function () {
323				var $this = $(this);
324				var myVal = $(this).data("value");
325				$this.appear(function() {
326					$(".blog .content-area").addClass( "animated fadeInLeft" );
327					$(".blog .widget-area").addClass( "animated fadeInRight" );
328				});
329			});
330		}
331		
332		/* -- ContactUs Section  */
333		if( $(".contactus-section").length ) {
334			$(".contactus-section").each(function () {
335				var $this = $(this);
336				var myVal = $(this).data("value");
337				$this.appear(function() {
338					$(".contactus-section .row .map").addClass( "animated rotateInDownLeft" );
339					$(".contactus-section .row .getintouch").addClass( "animated rotateInUpLeft" );
340					$(".contactus-section .contactdetail-block").addClass( "animated slideInLeft" );
341					
342				});
343			});
344		}
345		
346		/* -- Testimonial 2 Section */
347		if( $(".testimonial2-section").length ) {
348	
349			$( "#testimonial2 .total_index" ).html( $("#testimonial2 .item").length );
350			if( $("#testimonial2 .item").length > 1 ){
351				if( $("#testimonial2 .item.active").index() == 0 ){
352					$( "#testimonial2 .index_prev" ).html( $("#testimonial2 .item").length );
353					$( "#testimonial2 .index_next" ).html( $("#testimonial2 .item.active").index() + 2 );
354				} else if( $("#testimonial2 .item.active").index() == $("#testimonial2 .item").length - 1 ) {
355					$( "#testimonial2 .index_prev" ).html( $("#testimonial2 .item.active").index() );
356					$( "#testimonial2 .index_next" ).html( 1 );
357				} else {
358					$( "#testimonial2 .index_prev" ).html( $("#testimonial2 .item.active").index() );
359					$( "#testimonial2 .index_next" ).html( $("#testimonial2 .item.active").index() + 2 );
360				}
361			} else {
362				$( "#testimonial2 .index_prev" ).html( $("#testimonial2 .item").length );
363				$( "#testimonial2 .index_next" ).html( $("#testimonial2 .item").length );
364			}
365			
366			$("#testimonial2").on("slide.bs.carousel", function () {
367				
368				if( $("#testimonial2 .item").length > 1 ){
369					if( $("#testimonial2 .item.active").index() == 0 ){
370						$( "#testimonial2 .index_prev" ).html( $("#testimonial2 .item").length );
371						$( "#testimonial2 .index_next" ).html( $("#testimonial2 .item.active").index() + 2 );
372					} else if( $("#testimonial2 .item.active").index() == $("#testimonial2 .item").length - 1 ) {
373						$( "#testimonial2 .index_prev" ).html( $("#testimonial2 .item.active").index() );
374						$( "#testimonial2 .index_next" ).html( 1 );
375					} else {
376						$( "#testimonial2 .index_prev" ).html( $("#testimonial2 .item.active").index() );
377						$( "#testimonial2 .index_next" ).html( $("#testimonial2 .item.active").index() + 2 );
378					}
379				} else {
380					$( "#testimonial2 .index_prev" ).html( $("#testimonial2 .item").length );
381					$( "#testimonial2 .index_next" ).html( $("#testimonial2 .item").length );
382				}
383			});	
384			
385			$(".testimonial2-section").each(function () {
386				var $this = $(this);
387				var myVal = $(this).data("value");
388				$this.appear(function() {
389					$(".testimonial2-section").addClass( "animated lightSpeedIn");
390				});
391			});
392		}
393		
394		/* -- Contact Map */
395		if($("#map-canvas-contact").length==1){
396			initialize("map-canvas-contact");
397		}
398		
399		/* -- Contact Form */
400		$( "#btn_submit" ).on( "click", function(event) {
401		  event.preventDefault();
402		  var mydata = $("form").serialize();
403			$.ajax({
404				type: "POST",
405				dataType: "json",
406				url: "contact.php",
407				data: mydata,
408				success: function(data) {
409					if( data["type"] == "error" ){
410						$("#alert-msg").html(data["msg"]);
411						$("#alert-msg").removeClass("alert-msg-success");
412						$("#alert-msg").addClass("alert-msg-failure");
413						$("#alert-msg").show();
414					} else {
415						$("#alert-msg").html(data["msg"]);
416						$("#alert-msg").addClass("alert-msg-success");
417						$("#alert-msg").removeClass("alert-msg-failure");
418						$("#input_name").val("");
419						$("#input_email").val("");
420						$("#input_phone").val("");
421						$("#textarea_message").val("");
422						$("#alert-msg").show();
423					}
424				},
425				error: function(xhr, textStatus, errorThrown) {
426					alert(textStatus);
427				}
428			});
429			return false;
430			$("#contact-form").attr("action", "saveQuery").submit();
431		});
432		
433	});	/* -- Document Ready /- */
434	
435	/* ## Window Load - Handler for .load() called */
436	$(window).load(function() {
437		/* -- Site Loader */
438		if ( !$("html").is(".ie6, .ie7, .ie8") ) {
439			$("#site-loader").delay(1000).fadeOut("slow");
440		}
441		else {
442			$("#site-loader").css("display","none");
443		}
444	});
445
446})(jQuery);

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.