$(window).scroll(function(){var st = $(document).scrollTop();st >= 1000 ?$(".to-top").show(500) : $(".to-top").hide()$(".to-top").click(function () {$("html,body").animate({'scrollTop': 0,}, 200)return false;})})請大牛指教下,謝謝
1 回答
已采納

慕用0418482
TA貢獻98條經(jīng)驗 獲得超15個贊
點擊事件位置拿到外面來
$(window).scroll(function(){ ????var?st?=?$(document).scrollTop(); ????st?>=?1000???$(".to-top").show(500)?:?$(".to-top").hide() ????}) $(".to-top").click(function?()?{ ????$("html,body").animate({ ????'scrollTop':?0,},?200) ????return?false; ????})
- 1 回答
- 0 關(guān)注
- 1385 瀏覽
添加回答
舉報
0/150
提交
取消