开发者

Jquery Issue About ScrollTop coding

开发者 https://www.devze.com 2023-04-06 23:28 出处:网络
if($(\'html, body\').scrollTop().val() > 50){ $(\"#scrolltop\").css(\"display\", \"block\"); }; 开发者_如何转开发
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/

0

精彩评论

暂无评论...
验证码 换一张
取 消