I'm a js newbie and I'm trying to integrate the jQuery Easing Plugin (http://gsgd.co.uk/sandbox/jquery/easing/) into some of my .js:
$(function() {
var $root = $('html, body');
$('.project').click(function() {
var href = $.attr(this, 'href');
$root.animate({
scrollTop: $(href).offset().top
}, 1000, function () {
window.location.hash = href;
});
return false;
});
});
and
$(function(){
$(window).scroll(function(){
if ($(this).scrollTop() > 100) {
$('.scrollToTop').fadeIn();
} else {
$('.scrollToTop').fadeOut();
}
});
$('.scrollToTop').click(function(){
$('html, body').animate({scrollTop : 0},300);
return false;
});
});
I've tried adding
$(scrollElem).animate({scrollTop: targetOffset}, 300,
‘easeOutElastic’, function() {
And some similar others I've found, but I didn't get it working.
Any help? Thanks in advance.