if($('html, body').scrollTop().val() > 50){
$("#scrolltop").css("display", "block");
};
开发者_如何转开发
Those're my codes, but of course don't work. How can I apply to it with "if" questioning.. ?
Im not quite sure what you mean.
Do you have an element "scrolltop" which you only want to display if the body has scrolled passed 50px?
If so, here is an example: http://jsfiddle.net/t52HN/4/
精彩评论