Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- How to prevent button on the page loading?


toplisek - 12:47 pm on Jan 25, 2013 (gmt 0)


How to prevent button on the page loading?

I have code like:
<script type="text/javascript">
jQuery(document).ready(function(){

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;
});

});
</script>

What will influence != 0 or > 100 and why is button showing when I load page but when I scroll it will work?
Need help.


Thread source:: http://www.webmasterworld.com/javascript/4539236.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com