jQuery(document).ready(function($) { $("#gallery-carousel").owlCarousel({ autoPlay: 6000, //Set AutoPlay to 3 seconds pagination:false, navigation:true, navigationText:["",""], items : 3, itemsDesktop : [1199,3], itemsDesktopSmall : [979,3] }); $("#blog-carousel").owlCarousel({ autoPlay: 6000, //Set AutoPlay to 3 seconds pagination:false, navigation:false, navigationText:["",""], items : 2, itemsDesktop : [1199,2], itemsDesktopSmall : [979,1] }); $('.navbar-nav li.dropdown').hover(function() { $(this).addClass('open'); }, function() { $(this).removeClass('open'); }); $('.navbar-nav li.dropdown').click(function() { $(this).toggleClass('open'); }); $(window).scroll(function () { if ($(this).scrollTop() > 100) { $('.scroll-top').fadeIn(); } else { $('.scroll-top').fadeOut(); } }); $('.scroll-top').click(function () { $("html, body").animate({ scrollTop: 0 }, 600); return false; }); $('[data-toggle="tooltip"]').tooltip(); $('#home-room .item').each(function(){ var next = $(this).next(); if (!next.length) { next = $(this).siblings(':first'); } next.children(':first-child').clone().appendTo($(this)); for (var i=0;i<1;i++) { next=next.next(); if (!next.length) { next = $(this).siblings(':first'); } next.children(':first-child').clone().appendTo($(this)); } }); /* Demo Scripts for Bootstrap Carousel and Animate.css */ 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-slider'), $firstAnimatingElems = $myCarousel.find('.item:first').find("[data-animation ^= 'animated']"); //Initialize carousel $myCarousel.carousel(); //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); }); });