// FUNCION PARA ANCLAS $(function() { $('nav a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top -80 }, 2500); return false; } } }); $('.ancla_top[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top -70 }, 1800); return false; } } }); $('.btn_ancla[href*=#]:not([href=#])').click(function() { var strAncla=$(this).attr('href'); //id del ancla $('body,html').stop(true,true).animate({ scrollTop: $(strAncla).offset().top },1000); }); var myCarousel = ['#slider','',]; $.each(myCarousel, function( index, value ) { animateJu(value); }); //console.log(myCarousel); }); function animateJu(target){ var $myCarousel = $(target), $firstAnimatingElems = $myCarousel.find('.item:first').find("[data-animation ^= 'animated']"); $myCarousel.carousel(); doAnimations($firstAnimatingElems); $myCarousel.carousel('pause'); $myCarousel.on('slide.bs.carousel', function (e) { var $animatingElems = $(e.relatedTarget).find("[data-animation ^= 'animated']"); doAnimations($animatingElems); }); } function doAnimations( elems ) { var animEndEv = 'webkitAnimationEnd animationend'; elems.each(function () { var $this = $(this), $animationType = $this.data('animation'); $this.addClass($animationType).one(animEndEv, function () { $this.removeClass($animationType); }); }); } new WOW( { offset:0, mobile:true, live:true , }).init(); $(".carousel").on("touchstart",function(a){var o=a.originalEvent.touches[0].pageX;$(this).one("touchmove",function(a){var c=a.originalEvent.touches[0].pageX;Math.floor(o-c)>5?$(".carousel").carousel("next"):Math.floor(o-c)<-5&&$(".carousel").carousel("prev")}),$(".carousel").on("touchend",function(){$(this).off("touchmove")})});