admin管理员组文章数量:1392007
I have only one list div and I want to make it scrollable. I have seen scrollpane examples, it's great but I am looking for an smaller simpler alternative.
I appreciate any help.
Thanks.
I have only one list div and I want to make it scrollable. I have seen scrollpane examples, it's great but I am looking for an smaller simpler alternative.
I appreciate any help.
Thanks.
Share Improve this question asked Nov 19, 2010 at 15:18 Josh RJosh R 1,2956 gold badges19 silver badges31 bronze badges 4- have you already written some code to see? Are you trying to scroll an <ul> inside a shorter <div>? – fcalderan Commented Nov 19, 2010 at 15:24
-
Maybe try the smallest and simplest solution: css
overflow: auto;
bined with fixed height or width. – pawel Commented Nov 19, 2010 at 15:27 - @fcalderan Yeah <ul> inside a <div> – Josh R Commented Nov 19, 2010 at 15:33
- @pawel I also get a greyed out horizontal scroll which messes other elements on the page. – Josh R Commented Nov 19, 2010 at 15:44
2 Answers
Reset to default 3Don't think you need jquery, just add style="overflow:auto;" to the div.
For Future readers ...
If jQuery
is must then you can do this by :
// Any one accordingly ...
$('#yourIdForDiv').attr('overflow','auto');
$('#yourIdForDiv').attr('overflowy','scroll');
$('#yourIdForDiv').attr('overflowx','auto');
本文标签: javascriptHow to make a div scrollable using jqueryStack Overflow
版权声明:本文标题:javascript - How to make a div scrollable using jquery - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744772188a2624405.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论