smooth scroll like a smooth criminal
This commit is contained in:
parent
d9904ecd30
commit
0981f04c77
1 changed files with 9 additions and 3 deletions
|
|
@ -26,18 +26,24 @@ var View = {
|
|||
});
|
||||
|
||||
/*scroll to top */
|
||||
var back_to_top = jQuery('#back-to-top');
|
||||
jQuery(window).scroll(function(){
|
||||
if(jQuery(window).scrollTop() > 1000){
|
||||
// show back to top
|
||||
jQuery('#back-to-top').stop().animate({opacity: .5});
|
||||
back_to_top.stop().animate({opacity: .5});
|
||||
}
|
||||
else{
|
||||
// hide back to top
|
||||
jQuery('#back-to-top').stop().animate({opacity: 0});
|
||||
back_to_top.stop().animate({opacity: 0});
|
||||
}
|
||||
});
|
||||
|
||||
/* Showing debug messages */
|
||||
back_to_top.click(function(event){
|
||||
event.preventDefault();
|
||||
$('html,body').animate({scrollTop:0}, 500);
|
||||
})
|
||||
|
||||
/* Showing debug messages */
|
||||
$(this.debug.selector)
|
||||
.click(this.debug.click);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue