Javascript hide the scroll after clicking and reach the top of the page
I'm using this in my website: http://www.dy开发者_高级运维namicdrive.com/dynamicindex3/scrolltop.htm
and it works great for me. But the only thing that I face is that when I click on the picture, it's opacity become 0 but there is still a link in the same place of the picture. I want to hide the link as well! I have tried display none for the css in the js file but reached nothing!
$(window).scroll(function(){
var top = $(this).scrollTop();
if(top < 50){
$('.handle').fadeOut(100);
} else{
$('.handle').fadeIn(100);
}
});
Check this http://jsfiddle.net/EJjvt/1/
this.$control.stop().animate({opacity:1}, this.setting.fadeduration[0])//find
this.$control.stop().fadeIn(this.setting.fadeduration[0])//replace
find and replace the lines above, and also look for other animate({opacity}) functions and use them using common sense :) when its opacity:0 use fadeOut
Other wise leave everything as it is
and use this
function mychecker(){
if(!$('#topcontrol').is(':visible')){
$(this).hide();
}
setTimeout(function (){mychecker();},100);
}
the above will check every so often if the thing is visible or not and then hide the contents properly :)
精彩评论