PageSourceSearch

https://www.amilfreight.com/assets/Site/js/scroll.js?v=27349

js amilfreight.com collected 2026-09-24 11:04:39 UTC 6,838 bytes, 258 lines download raw bytes

1
2
3
4// Scroll
5
6
7//$("html").niceScroll({
8//  cursorwidth:5,
9//  cursoropacitymin:0.4,
10//  cursorcolor:'#6e8cb6',
11//  cursorborder:'none',
12//  cursorborderradius:0,
13//  autohidemode:'leave',
14//  scrollspeed: 100, // scrolling speed
15//  mousescrollstep: 40,
16//  smoothscroll: true
17//});
18
19// accordion
20
21var acc = document.getElementsByClassName("accordion");
22var i;
23
24for (i = 0; i < acc.length; i++) {
25  acc[i].addEventListener("click", function () {
26    this.classList.toggle("active");
27    var panel = this.nextElementSibling;
28    if (panel.style.maxHeight) {
29      panel.style.maxHeight = null;
30    } else {
31      panel.style.maxHeight = panel.scrollHeight + "px";
32    }
33  });
34}
35
36
37// tweenmax slider
38
39var slideshowDuration = 4000;
40var slideshow=$('.main-content .slideshow');
41
42function slideshowSwitch(slideshow,index,auto){
43  if(slideshow.data('wait')) return;
44
45  var slides = slideshow.find('.slide');
46  var pages = slideshow.find('.pagination');
47  var activeSlide = slides.filter('.is-active');
48  var activeSlideImage = activeSlide.find('.image-container');
49  var newSlide = slides.eq(index);
50  var newSlideImage = newSlide.find('.image-container');
51  var newSlideContent = newSlide.find('.slide-content');
52  var newSlideElements=newSlide.find('.caption > *');
53  if(newSlide.is(activeSlide))return;
54
55  newSlide.addClass('is-new');
56  var timeout=slideshow.data('timeout');
57  clearTimeout(timeout);
58  slideshow.data('wait',true);
59  var transition=slideshow.attr('data-transition');
60  if(transition=='fade'){
61    newSlide.css({
62      display:'block',
63      zIndex:2
64    });
65    newSlideImage.css({
66      opacity:0
67    });
68
69    TweenMax.to(newSlideImage,1,{
70      alpha:1,
71      onComplete:function(){
72        newSlide.addClass('is-active').removeClass('is-new');
73        activeSlide.removeClass('is-active');
74        newSlide.css({display:'',zIndex:''});
75        newSlideImage.css({opacity:''});
76        slideshow.find('.pagination').trigger('check');
77        slideshow.data('wait',false);
78        if(auto){
79          timeout=setTimeout(function(){
80            slideshowNext(slideshow,false,true);
81          },slideshowDuration);
82          slideshow.data('timeout',timeout);}}});
83  } else {
84    if(newSlide.index()>activeSlide.index()){
85      var newSlideRight=0;
86      var newSlideLeft='auto';
87      var newSlideImageRight=-slideshow.width()/8;
88      var newSlideImageLeft='auto';
89      var newSlideImageToRight=0;
90      var newSlideImageToLeft='auto';
91      var newSlideContentLeft='auto';
92      var newSlideContentRight=0;
93      var activeSlideImageLeft=-slideshow.width()/4;
94    } else {
95      var newSlideRight='';
96      var newSlideLeft=0;
97      var newSlideImageRight='auto';
98      var newSlideImageLeft=-slideshow.width()/8;
99      var newSlideImageToRight='';
100      var newSlideImageToLeft=0;
101      var newSlideContentLeft=0;
102      var newSlideContentRight='auto';
103      var activeSlideImageLeft=slideshow.width()/4;
104    }
105
106    newSlide.css({
107      display:'block',
108      width:0,
109      right:newSlideRight,
110      left:newSlideLeft
111      ,zIndex:2
112    });
113
114    newSlideImage.css({
115      width:slideshow.width(),
116      right:newSlideImageRight,
117      left:newSlideImageLeft
118    });
119
120    newSlideContent.css({
121      width:slideshow.width(),
122      left:newSlideContentLeft,
123      right:newSlideContentRight
124    });
125
126    activeSlideImage.css({
127      left:0
128    });
129
130    TweenMax.set(newSlideElements,{y:20,force3D:true});
131    TweenMax.to(activeSlideImage,1,{
132      left:activeSlideImageLeft,
133      ease:Power3.easeInOut
134    });
135
136    TweenMax.to(newSlide,1,{
137      width:slideshow.width(),
138      ease:Power3.easeInOut
139    });
140
141    TweenMax.to(newSlideImage,1,{
142      right:newSlideImageToRight,
143      left:newSlideImageToLeft,
144      ease:Power3.easeInOut
145    });
146
147    TweenMax.staggerFromTo(newSlideElements,0.8,{alpha:0,y:60},{alpha:1,y:0,ease:Power3.easeOut,force3D:true,delay:0.6},0.1,function(){
148      newSlide.addClass('is-active').removeClass('is-new');
149      activeSlide.removeClass('is-active');
150      newSlide.css({
151        display:'',
152        width:'',
153        left:'',
154        zIndex:''
155      });
156
157      newSlideImage.css({
158        width:'',
159        right:'',
160        left:''
161      });
162
163      newSlideContent.css({
164        width:'',
165        left:''
166      });
167
168      newSlideElements.css({
169        opacity:'',
170        transform:''
171      });
172
173      activeSlideImage.css({
174        left:''
175      });
176
177      slideshow.find('.pagination').trigger('check');
178      slideshow.data('wait',false);
179      if(auto){
180        timeout=setTimeout(function(){
181          slideshowNext(slideshow,false,true);
182        },slideshowDuration);
183        slideshow.data('timeout',timeout);
184      }
185    });
186  }
187}
188
189function slideshowNext(slideshow,previous,auto){
190  var slides=slideshow.find('.slide');
191  var activeSlide=slides.filter('.is-active');
192  var newSlide=null;
193  if(previous){
194    newSlide=activeSlide.prev('.slide');
195    if(newSlide.length === 0) {
196      newSlide=slides.last();
197    }
198  } else {
199    newSlide=activeSlide.next('.slide');
200    if(newSlide.length==0)
201      newSlide=slides.filter('.slide').first();
202  }
203
204  slideshowSwitch(slideshow,newSlide.index(),auto);
205}
206
207function homeSlideshowParallax(){
208  var scrollTop=$(window).scrollTop();
209  if(scrollTop>windowHeight) return;
210  var inner=slideshow.find('.slideshow-inner');
211  var newHeight=windowHeight-(scrollTop/2);
212  var newTop=scrollTop*0.8;
213
214  inner.css({
215    transform:'translateY('+newTop+'px)',height:newHeight
216  });
217}
218
219$(document).ready(function() {
220 $('.slide').addClass('is-loaded');
221
222 $('.slideshow .arrows .arrow').on('click',function(){
223  slideshowNext($(this).closest('.slideshow'),$(this).hasClass('prev'));
224});
225
226 $('.slideshow .pagination .item').on('click',function(){
227  slideshowSwitch($(this).closest('.slideshow'),$(this).index());
228});
229
230 $('.slideshow .pagination').on('check',function(){
231  var slideshow=$(this).closest('.slideshow');
232  var pages=$(this).find('.item');
233  var index=slideshow.find('.slides .is-active').index();
234  pages.removeClass('is-active');
235  pages.eq(index).addClass('is-active');
236});
237
238/* Lazyloading
239$('.slideshow').each(function(){
240  var slideshow=$(this);
241  var images=slideshow.find('.image').not('.is-loaded');
242  images.on('loaded',function(){
243    var image=$(this);
244    var slide=image.closest('.slide');
245    slide.addClass('is-loaded');
246  });
247*/
248
249var timeout=setTimeout(function(){
250  slideshowNext(slideshow,false,true);
251},slideshowDuration);
252
253slideshow.data('timeout',timeout);
254});
255
256if($('.main-content .slideshow').length > 1) {
257  $(window).on('scroll',homeSlideshowParallax);
258}

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.