Page is a not externally linkable
Fotiman - 2:11 pm on Jan 25, 2013 (gmt 0)
You're attaching an event listener to the window's scroll event. When the page first loads, that event won't be fired, so you need to also repeat that functionality in the ready method.
jQuery(document).ready(function () {
if (jQuery(window).scrollTop() != 0) {
jQuery('.mybutton1').fadeIn();
} else {
jQuery('.mybutton1').fadeOut();
}
jQuery(window).scroll(function () {
if (jQuery(this).scrollTop() != 0) {
jQuery('.mybutton1').fadeIn();
} else {
jQuery('.mybutton1').fadeOut();
}
});
jQuery('.mybutton1').click(function () {
jQuery("html, body").animate({
scrollTop: 0
}, 850);
return false;
});
});