Update niggascript.js

This commit is contained in:
talksik
2016-05-14 18:58:21 -07:00
parent ce8f19cd88
commit 314522d800
+23 -4
View File
@@ -1,15 +1,34 @@
$(window).scroll(
{
previousTop: 100%
previousTop: 900
},
function () {
var currentTop = $(window).scrollTop();
if (currentTop < this.previousTop) {
$(".sidebar em").text("Up"); /* optional for demo */
$(".header").show();
} else {
$(".header").show();
}
else {
$(".sidebar em").text("Down");
$(".header").hide();
}
this.previousTop = currentTop;
this.previousTop = currentTop;
});
$(function(){
$('a[href^="#"]').click(function(e){
var target = $(this).attr('href');
var strip = target.slice(1);
var anchor = $("a[name='"+ strip +"']");
e.preventDefault();
$('html, body').animate({
scrollTop: anchor.offset().top
}, 'slow');
});
});