【问题标题】:Jquery - Scroll a DIV(overflow:auto;) with a DIVJquery - 使用 DIV 滚动 DIV(overflow:auto;)
【发布时间】:2011-02-10 04:59:43
【问题描述】:


如何使用 DIV 滚动 DIV (overflow:auto;)?

HTML

<div style="width:100px; height:200px; border:1px solid #ff0000; overflow:hidden;">
   <div id="my_div" style="width:100%; padding-right:20px; height:100%; overflow:auto;" class="sph">
       <div style=" background-color:#c6c6c6; width:10px; height:20px; position: absolute; left:80px; cursor:pointer;" >S</div>
       .. content ...  <br />       .. content ...  <br />       .. content ...  <br />
       .. content ...  <br />       .. content ...  <br />       .. content ...  <br />
       .. content ...  <br />       .. content ...  <br />       .. content ...  <br />
       .. content ...  <br />       .. content ...  <br />       .. content ...  <br />
       .. content ...  <br />       .. content ...  <br />       .. content ...  <br />
       .. content ...  <br />       .. content ...  <br />       .. content ...  <br />
       .. content ...  <br />       .. content ...  <br />       .. content ...  <br />       
   </div>

</div>

<br /><br >
  Use the MouseScroll to scroll or use the [S]croll Div

示例 http://jsfiddle.net/sbAfW/11/

提前致谢!
彼得

【问题讨论】:

  • Amm,它似乎在为我滚动……你想在这里做什么?

标签: jquery scroll overflow


【解决方案1】:

查看jScrollPane plugin

the demo page 上的第一个演示是您可能正在寻找的。您可以从 jspVerticalBar 和 jspTrack 类中删除背景属性,然后就可以了!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-11-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-30
    • 1970-01-01
    • 2011-07-14
    • 1970-01-01
    相关资源
    最近更新 更多