PageSourceSearch

https://www.afaindia.com/js/custom.js

js afaindia.com collected 2026-10-10 00:45:15 UTC 9,366 bytes, 182 lines download raw bytes

vendor: 5,569 bytes, lines 1-46
1/*!
2 * @preserve
3 *
4 * Readmore.js jQuery plugin
5 * Author: @jed_foster
6 * Project home: http://jedfoster.github.io/Readmore.js
7 * Licensed under the MIT license
8 *
9 * Debounce function from http://davidwalsh.name/javascript-debounce-function
10 */
11!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){"use strict";function e(t,e,i){var o;return function(){var n=this,a=arguments,s=function(){o=null,i||t.apply(n,a)},r=i&&!o;clearTimeout(o),o=setTimeout(s,e),r&&t.apply(n,a)}}function i(t){var e=++h;return String(null==t?"rmjs-":t)+e}function o(t){var e=t.clone().css({height:"auto",width:t.width(),maxHeight:"none",overflow:"hidden"}).insertAfter(t),i=e.outerHeight(),o=parseInt(e.css({maxHeight:""}).css("max-height").replace(/[^-\d\.]/g,""),10),n=t.data("defaultHeight");e.remove();var a=o||t.data("collapsedHeight")||n;t.data({expandedHeight:i,maxHeight:o,collapsedHeight:a}).css({maxHeight:"none"})}function n(t){if(!d[t.selector]){var e=" ";t.embedCSS&&""!==t.blockCSS&&(e+=t.selector+" + [data-readmore-toggle], "+t.selector+"[data-readmore]{"+t.blockCSS+"}"),e+=t.selector+"[data-readmore]{transition: height "+t.speed+"ms;overflow: hidden;}",function(t,e){var i=t.createElement("style");i.type="text/css",i.styleSheet?i.styleSheet.cssText=e:i.appendChild(t.createTextNode(e)),t.getElementsByTagName("head")[0].appendChild(i)}(document,e),d[t.selector]=!0}}function a(e,i){this.element=e,this.options=t.extend({},r,i),n(this.options),this._defaults=r,this._name=s,this.init(),window.addEventListener?(window.addEventListener("load",c),window.addEventListener("resize",c)):(window.attachEvent("load",c),window.attachEvent("resize",c))}var s="readmore",r={speed:100,collapsedHeight:200,heightMargin:16,moreLink:'<a href="#">Read More</a>',lessLink:'<a href="#">Close</a>',embedCSS:!0,blockCSS:"display: block; width: 100%;",startOpen:!1,blockProcessed:function(){},beforeToggle:function(){},afterToggle:function(){}},d={},h=0,c=e(function(){t("[data-readmore]").each(function(){var e=t(this),i="true"===e.attr("aria-expanded");o(e),e.css({height:e.data(i?"expandedHeight":"collapsedHeight")})})},100);a.prototype={init:function(){var e=t(this.element);e.data({defaultHeight:this.options.collapsedHeight,heightMargin:this.options.heightMargin}),o(e);var n=e.data("collapsedHeight"),a=e.data("heightMargin");if(e.outerHeight(!0)<=n+a)return this.options.blockProcessed&&"function"==typeof this.options.blockProcessed&&this.options.blockProcessed(e,!1),!0;var s=e.attr("id")||i(),r=this.options.startOpen?this.options.lessLink:this.options.moreLink;e.attr({"data-readmore":"","aria-expanded":this.options.startOpen,id:s}),e.after(t(r).on("click",function(t){return function(i){t.toggle(this,e[0],i)}}(this)).attr({"data-readmore-toggle":s,"aria-controls":s})),this.options.startOpen||e.css({height:n}),this.options.blockProcessed&&"function"==typeof this.options.blockProcessed&&this.options.blockProcessed(e,!0)},toggle:function(e,i,o){o&&o.preventDefault(),e||(e=t('[aria-controls="'+this.element.id+'"]')[0]),i||(i=this.element);var n=t(i),a="",s="",r=!1,d=n.data("collapsedHeight");n.height()<=d?(a=n.data("expandedHeight")+"px",s="lessLink",r=!0):(a=d,s="moreLink"),this.options.beforeToggle&&"function"==typeof this.options.beforeToggle&&this.options.beforeToggle(e,n,!r),n.css({height:a}),n.on("transitionend",function(i){return function(){i.options.afterToggle&&"function"==typeof i.options.afterToggle&&i.options.afterToggle(e,n,r),t(this).attr({"aria-expanded":r}).off("transitionend")}}(this)),t(e).replaceWith(t(this.options[s]).on("click",function(t){return function(e){t.toggle(this,i,e)}}(this)).attr({"data-readmore-toggle":n.attr("id"),"aria-controls":n.attr("id")}))},destroy:function(){t(this.element).each(function(){var e=t(this);e.attr({"data-readmore":null,"aria-expanded":null}).css({maxHeight:"",height:""}).next("[data-readmore-toggle]").remove(),e.removeData()})}},t.fn.readmore=function(e){var i=arguments,o=this.selector;return e=e||{},"object"==typeof e?this.each(function(){if(t.data(this,"plugin_"+s)){var i=t.data(this,"plugin_"+s);i.destroy.apply(i)}e.selector=o,t.data(this,"plugin_"+s,new a(this,e))}):"string"==typeof e&&"_"!==e[0]&&"init"!==e?this.each(function(){var o=t.data(this,"plugin_"+s);o instanceof a&&"function"==typeof o[e]&&o[e].apply(o,Array.prototype.slice.call(i,1))}):void 0}});
12
13
14$(document).ready(function(e) {
15
16	'use strict';
17	
18	$('.vbs1 p').readmore({
19  speed: 75,
20  moreLink: '<a href="#"><span>Read more <i class="fa fa-caret-right "></i></span></a>',
21  lessLink: '<a href="#"><span>Read less <i class="fa fa-caret-right "></i></span></a>',
22  collapsedHeight:50,
23  afterToggle: function(trigger, element, expanded) {
24    if(! expanded) { // The "Close" link was clicked
25      $('html, body').animate( { scrollTop: element.offset().top }, {duration: 100 } );
26    }
27  }
28});
29$('.vbs2 .cp').readmore({
30  speed: 75,
31  moreLink: '<a href="#"><span>Read more <i class="fa fa-caret-right "></i></span></a>',
32  lessLink: '<a href="#"><span>Read less <i class="fa fa-caret-right "></i></span></a>',
33  collapsedHeight:100,
34  afterToggle: function(trigger, element, expanded) {
35    if(! expanded) { // The "Close" link was clicked
36      $('html, body').animate( { scrollTop: element.offset().top }, {duration: 100 } );
37    }
38  }
39});
40	
41	$('.jBar').hide();
42	$('.jRibbon').show().removeClass('up', 500);
43	
44	$('#centres').click(function(){
45		$('.jRibbon').toggleClass('up', 500);
46		$('#centres').toggleClass('up', 500);
47		$('.jBar').slideToggle();
48	});
49	$('.jTrigger').click(function(){
50		$('.jRibbon').toggleClass('up', 500);
51		$('.jBar').slideToggle();
52	});
53	
54	$('#addrclose').click(function(){
55		$('.jRibbon').toggleClass('up', 500);
56	$('.jBar').slideToggle();
57	});
58	
59	
60	   // Inline popups
61$('#inline-popups').magnificPopup({
62  delegate: 'a',
63  removalDelay: 500, //delay removal by X to allow out-animation
64  callbacks: {
65    beforeOpen: function() {
66       this.st.mainClass = this.st.el.attr('data-effect');
67    }
68  },
69  midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
70});
71$(".showenqpopup").magnificPopup({
72 // delegate: 'a',
73  removalDelay: 500, //delay removal by X to allow out-animation
74  callbacks: {
75    beforeOpen: function() {
76       this.st.mainClass = this.st.el.attr('data-effect');
77    }
78  },
79  midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
80});
81 
82
83$('.owl-carousel.has-lightbox').magnificPopup({
84		delegate: '.owl-item:not(.cloned) div img',
85		type: 'image',
86		removalDelay: 500, //delay removal by X to allow out-animation
87			zoom: {enabled: true, duration: 300},
88			closeOnContentClick: true,
89           			
90		callbacks: { 
91		elementParse: function(item) {
92                    item.src = item.el.attr('src');
93		          },
94			beforeOpen: function() {
95				// just a hack that adds mfp-anim class to markup 
96				
97				 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
98				 this.st.mainClass = this.st.el.attr('data-effect');
99			}
100		},
101		tLoading: 'Loading image #%curr%...',
102		mainClass: 'mfp-with-zoom',
103		gallery: {
104			enabled: true,
105			navigateByImgClick: true,
106			preload: [0,1] // Will preload 0 - before current, and 1 after the current image
107		},
108		image: {
109			  verticalFit: true,
110			tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
111			titleSrc: function(item) {
112				return item.el.attr('title') + '<small></small>';
113			}
114		}
115	});	
116
117	   // Inline popups
118$('.opencareer').magnificPopup({
119//  delegate: 'a',
120  removalDelay: 500, //delay removal by X to allow out-animation
121  callbacks: {
122    beforeOpen: function() {
123       this.st.mainClass = this.st.el.attr('data-effect');
124    }
125  },
126  midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
127});
128
129// Image popups
130/*$('#image-popups').magnificPopup({
131  delegate: 'a',
132  type: 'image',
133  removalDelay: 500, //delay removal by X to allow out-animation
134  callbacks: {
135    beforeOpen: function() {
136      // just a hack that adds mfp-anim class to markup 
137       this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
138       this.st.mainClass = this.st.el.attr('data-effect');
139    }
140  },
141  closeOnContentClick: true,
142  midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
143});
144*/
145
146// Hinge effect popup
147/*$('a.hinge').magnificPopup({
148  mainClass: 'mfp-with-fade',
149  removalDelay: 1000, //delay removal by X to allow out-animation
150  callbacks: {
151    beforeClose: function() {
152        this.content.addClass('hinge');
153    }, 
154    close: function() {
155        this.content.removeClass('hinge'); 
156    }
157  },
158  midClick: true
159});
160	*/
161	
162
163	
164	$('#enquiry').magnificPopup({
165// delegate: 'a',
166  removalDelay: 500, //delay removal by X to allow out-animation
167  callbacks: {
168    beforeOpen: function() {
169       this.st.mainClass = this.st.el.attr('data-effect');
170    }
171  },
172  midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
173});
174	
175
176		
177//$('#enquiry').magnificPopup('open');
178
179	
180	});
181
182

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.