PageSourceSearch

https://www.dilmahconservation.org/js/layout_7338.js

js dilmahconservation.org collected 2026-10-02 11:33:10 UTC 7,565 bytes, 217 lines download raw bytes

1var jrtime = new Date().getTime();
2var utimeout = false;
3var jdelta = 200;
4
5$(document).ready(function () {
6  //$('.list-with-title-items-image-sub-title-content-link .x-list-item-wrapper .x-list-item:nth-child(4n+1)').addClass('first-child');
7  firstChild();
8
9  $(window).resize(function() {
10    jrtime = new Date();
11    if ( utimeout === false) {
12      utimeout = true;
13      setTimeout(adjustLayoutt, jdelta);
14    }
15  });
16
17  XboxRotatorWrapDiv();
18  imageLodeMore();
19  hoverEfect();
20  
21  $('.main .content-wrapper.slick ul.x-list-item-wrapper li.active > a').click(function(evt){
22    evt.preventDefault();
23  });
24  
25  
26
27});
28
29$(window).load(function () {
30  setEqualHeight();
31  $('.main .row.fe-section-one').removeClass('animals');
32}).resize(debouncer(function (e) {
33
34}));
35
36
37function XboxRotatorWrapDiv() {
38    var slideIndex;
39  $('.all-element-rotator .content-wrapper .x-list-item-wrapper').slick({
40    slide:'.all-element-rotator .content-wrapper .x-list-item-wrapper .x-list-item',
41    slidesToShow: 1,
42    swipeToSlide: true,
43    dots: false,
44    customPaging: function(slider, i) {
45      return '<i class="fa fa-circle-thin paging-circle"></i>';},
46      swipeToSlide: true,
47      mobileFirst: true,
48      prevArrow:'<span class="arrow-prev"></span>',
49      nextArrow:'<span class="arrow-next"></span>',      
50      responsive: [
51      {
52        breakpoint: 750,
53        settings: {
54          slidesToShow: 4,
55          slidesToScroll: 4
56        }
57      },
58      {
59        breakpoint: 1000,
60        settings: {
61          slidesToShow: 4,
62          slidesToScroll: 4
63        }
64      }
65      ]
66    })    .on({beforeChange: function (event, slick, current_slide_index, next_slide_index) {
67      $('.all-element-rotator .content-wrapper .x-list-item-wrapper .slick-dots li').html('<i class="fa fa-circle-thin"></i>');
68      $('.all-element-rotator .content-wrapper .x-list-item-wrapper .slick-dots li:eq('+next_slide_index+')').html('<i class="fa fa-circle theme-color"></i>');
69    }
70  });
71  
72    $('.all-element-rotator .content-wrapper .x-list-item-wrapper .slick-dots li:eq('+$('.all-element-rotator .content-wrapper .x-list-item-wrapper').slick('slickCurrentSlide')+')').html('<i class="fa fa-circle theme-color theme-color"</i>');
73    
74     var slideIndex = $('.all-element-rotator .content-wrapper .x-list-item-wrapper .x-list-item.active').index();
75    $('.all-element-rotator .content-wrapper .x-list-item-wrapper')[0].slick.slickGoTo(parseInt(slideIndex));
76    
77  } 
78
79
80function adjustLayoutt() {
81  if (new Date().getTime() - jrtime < jdelta) {
82    setTimeout(adjustLayoutt, jdelta);
83  } else {
84    utimeout = false;
85    var winWidth = $(window).width();
86    firstChild();
87    setEqualHeight();
88  }
89}
90
91
92
93
94function setEqualHeight(){
95  equalDimension($('.main .row.fe-section-two  .x-list-item-wrapper .x-list-item'), 'height');
96}
97
98function equalDimension(selector, fn) {
99  $(selector).css(fn, '');
100  var $elements = $(selector),
101      dimensions = $elements.map(function (i) {
102        return $elements.eq(i)[fn]();
103      }),
104      maxDimension = Math.max.apply(Math, dimensions);
105  $elements[fn](maxDimension);
106}
107
108
109
110
111function imageLodeMore(){
112  pageNumber = 1;
113  var datarec='';
114  var alttag;
115
116  $('.main .see-more').addClass('disable');
117
118
119  if($('.main .see-more a.read-more').attr('data-pages') === ''||$('.main .see-more a.read-more').attr('data-pages')==1){
120    $('.main .see-more').addClass('disable');
121  }else{
122    $('.main .see-more').removeClass('disable');
123  }
124
125  $('.main .see-more a.read-more').click(function (evt) {
126    evt.preventDefault();
127    $('body').append('<span class="background overlay"></span>');
128    $('body').append('<span class=" background bac-loader"></span>');
129    if($('.main .see-more > a').attr('data-pages') >= pageNumber ){
130      pageNumber++;
131
132      $.ajax({
133        url: 'animals.php?page='+pageNumber+'&format=json',
134        async: false,
135        success: function (data) {
136          results = $.parseJSON(data);
137          var records = results.data;
138          if (results.success) {
139            $.each(records, function (name, value) {
140              $.each(value, function (names, values) {
141                alttag=value.description;
142   
143
144                datarec='<div class="x-list-item clearfix three columns">';
145                datarec+='<div class="image-wrapper">';
146                datarec+='<img class="default vmb2 u-full-width" src="'+values.thumb_image+'" title="'+values.name+'" alt="'+values.name+'">';
147                datarec+='</div>';
148                datarec+='<div class="content-wrapper"><div class="content-inner-wrapper center">';
149                datarec+='<h3 class="animal-profile">'+values.name+'</h3>';
150                datarec+='<h4 class="animal-profile">
150'+values.scientific_name+'</h4>';
151                datarec+='<a href="/about-animals/'+values.url+'" data-infor="'+values.url+'" class="read-more theme-color center">Explore</a>';
152                datarec+='</div></div></div>';
153                $('.x-list.list-with-title-items-image-sub-title-content-link .x-list-item-wrapper').append(datarec);
154              });
155            });   
156         
157            //$('.main .row.fe-section-two .x-list-item:nth-child(4n+1)').addClass('first-child');
158            firstChild();
159            setTimeout(function () {
160              $('span.background.bac-loader,span.background.overlay').remove();  
161            }, 1000);
162
163            if( $('.main .see-more a.read-more').attr('data-pages') == pageNumber){
164              $('.main .see-more').addClass('disable');
165            }
166          }
167        }
168      });
169    }
170  });
171}
172
173
174
175function firstChild(){
176  $('.list-with-title-items-image-sub-title-content-link .x-list-item-wrapper .x-list-item').each(function(){
177    $('.list-with-title-items-image-sub-title-content-link .x-list-item-wrapper .x-list-item').removeClass('first-child');
178  });
179  if($(window).width() > 981){
180    $('.list-with-title-items-image-sub-title-content-link .x-list-item-wrapper .x-list-item:nth-child(4n+1)').addClass('first-child');
181    $('.list-with-title-items-image-sub-title-content-link .x-list-item-wrapper .x-list-item').each(function(){
182      $(this).removeClass('four');
183      $(this).removeClass('six');
184      $(this).addClass('three');
185
186    });
187
188  }
189  else if($(window).width() < 980 && 740 < $(window).width()){
190    $('.list-with-title-items-image-sub-title-content-link .x-list-item-wrapper .x-list-item:nth-child(3n+1)').addClass('first-child');
191    $('.list-with-title-items-image-sub-title-content-link .x-list-item-wrapper .x-list-item').each(function(){
192      $(this).removeClass('three');
193      $(this).removeClass('six');
194      $(this).addClass('four');
195    });
196  }else {
197    $('.list-with-title-items-image-sub-title-content-link .x-list-item-wrapper .x-list-item:nth-child(2n+1)').addClass('first-child');
198    $('.list-with-title-items-image-sub-title-content-link .x-list-item-wrapper .x-list-item').each(function(){
199      $(this).removeClass('three');
200      $(this).removeClass('four');
201      $(this).addClass('six');
202    });
203  }
204}
205
206
207function hoverEfect(){
208  $('.main .fe-section-one ul li.x-list-item').each(function(){
209    var pieces=$(this).find('.image-wrapper img').attr('src').split('/');
210    var imgSrc=pieces[pieces.length-1];
211    var nImg=imgSrc.split('.')[0];
212    var activeLen=nImg.split('_')[1];
213    if(activeLen===undefined){
214      $(this).find('.image-wrapper').append('<img class="default vmb2 background-image" src="'+window.location.protocol+'//'+window.location.host+'/images/animal-profile/animal-icons/'+nImg+'_active.png">');
215    }
216  });
217}

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.