2011-02-09 283 views
0


我如何滾動DIV(溢出:自動;)與DIV?Jquery - 滾動DIV(溢出:自動;)與DIV

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/

在此先感謝!
彼得

+0

Amm,它似乎在滾動我..你想在這裏做什麼? – 2011-02-09 20:39:51

回答

3

查看jScrollPane plugin

the demo page的第一個演示就是你可能要找的。你可以從jspVerticalBar和jspTrack類中移除背景屬性,然後就可以了!

+0

非常感謝! – Peter 2011-02-10 08:35:32