Tuesday, September 11, 2012

Smooth Scroll jQuery


<script type="text/javascript">
$(function() {
$('.parallex_controllers a').bind('click',function(event){
var $anchor = $(this);

$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1500,'easeInOutExpo');
/*
if you don't want to use the easing effects:
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1000);
*/
event.preventDefault();
});
});
});
</script>

No comments:

Post a Comment