123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- jQuery(function ($) {
- 'use strict';
- // Hide Mobile Menu On Click
- // Search
- // Progress Bar
- // Navigation Scroll
- // Sticky Nav
- // Parallax Scrolling
- // Cubeportfolio
- // Slick Slider
- // TheiaStickySidebar
- // Animationend
- // Gmap
-
- /*==============================================================*/
- // Animationend
- /*==============================================================*/
- (function( $ ) {
- //Function to animate slider captions
- function doAnimations( elems ) {
- //Cache the animationend event in a variable
- var animEndEv = 'webkitAnimationEnd animationend';
-
- elems.each(function () {
- var $this = $(this),
- $animationType = $this.data('animation');
- $this.addClass($animationType).one(animEndEv, function () {
- $this.removeClass($animationType);
- });
- });
- }
-
- //Variables on page load
- var $myCarousel = $('#home-carousel'),
- $firstAnimatingElems = $myCarousel.find('.item:first').find("[data-animation ^= 'animated']");
-
- //Initialize carousel
- $myCarousel.carousel({pause:"hover"});
-
- //Animate captions in first slide on page load
- doAnimations($firstAnimatingElems);
-
- //Pause carousel
- $myCarousel.carousel('pause');
-
- //Other slides to be animated on carousel slide event
- $myCarousel.on('slide.bs.carousel', function (e) {
- var $animatingElems = $(e.relatedTarget).find("[data-animation ^= 'animated']");
- doAnimations($animatingElems);
- });
-
- })(jQuery);
-
- // script end
- });
|