菜单切换
FACESOHO知行者
心灵
记录
远方
赞赏工具
源代码:
点击运行
保存
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>小鸟启蒙(facesoho.com)</title> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"> </script> <script> x=0; $(document).ready(function(){ $("div").scroll(function(){ $("span").text(x+=1); }); }); </script> </head> <body> <p>尝试滚动 div 中的滚动条</p> <div style="border:1px solid black;width:200px;height:100px;overflow:scroll;">小鸟启蒙 —— 学的不仅是技术,更是梦想!小鸟启蒙 —— 学的不仅是技术,更是梦想! <br><br> 小鸟启蒙 —— 学的不仅是技术,更是梦想!小鸟启蒙 —— 学的不仅是技术,更是梦想!</div> <p>滚动了 <span>0</span> 次。</p> </body> </html>
运行结果