rexjiang92
6/24/2016 - 4:35 PM

auto scroll js on locarno

<script>
$(function() {
  var height = $("#pre-header-wrapper").outerHeight();
  if ($("body").hasClass("logged-in")){
    var heightLoggedin = $(".admin-navbar-collapse").outerHeight();
    height += heightLoggedin;
  }
  height += 20;


  if(window.location.hash) {              
   $('html, body').animate({             
     scrollTop: $(window.location.hash).offset().top - height         
   }, 1000);     
 }


 $('.navbar-nav a[href*="#"]:not([href="#"])').addClass('scroll');
 $('.carousel-caption .btn').addClass('scroll');
 $('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 - height
      }, 1000);
      return false;
    }
  }
});
});


$(document).ready(function(){
  aw.cache.carouselFrontpageSlideSpeed = 10000;
  aw.cache.carouselFrontpagePause = false;
  aw.cache.carouselFrontpageInterval = 10000;
  $('#carousel-frontpage').carousel({
    slideSpeed: aw.cache.carouselFrontpageSlideSpeed, //changes the speed
    pause: aw.cache.carouselFrontpagePause,
    interval: aw.cache.carouselFrontpageInterval
  });

  $('.field-field-team-member-email .field-item').append( $('.btn-contact')  );
});
</script>