JavaScript - how to add scrollbar to div tag

Asked By theiry henry on 08-May-09 06:44 AM
how to add scrollbar to div tag?

if i giv style="overflow:scroll" it work fine in mozilla but does not work in iexplorer.

re

Web Star replied to theiry henry on 08-May-09 06:47 AM

fixed width and put orverflow auto

<div style="HEIGHT: 500px; WIDTH: 1000px; OVERFLOW: auto"></div>

Ravenet Rasaiyah replied to theiry henry on 08-May-09 06:47 AM
Hi

Here best solution to this and work with most of the browser

http://www.dyn-web.com/code/scroll/

http://www.dyn-web.com/code/scroll/vert.php

thank you

re

MySpider DotNet replied to theiry henry on 08-May-09 06:49 AM
<DIV style="overflow:auto;width:100px;height:100px;text-align:left;" dir="rtl">

asdf<BR>asdf<BR>asdf<BR>asdf<BR>asdf<BR>asdf<BR>asdf<BR>asdf<BR>

</DIV>
Its yet another one
Santhosh N replied to theiry henry on 08-May-09 07:00 AM

cross browser hack needs to be done..

You need to use this seperately for different browsers...

 overflow: auto works in IE and

overflow:scroll works in Firefox...

I would recommend you to have an external CSS defined with all the CSS and use them and you can load different CSS depending on the Browser as mentioned here

http://www.thesitewizard.com/css/excludecss.shtml

 

overflow:scroll
mv ark replied to theiry henry on 08-May-09 07:04 AM
overflow is a CSS 2 standard that works in both IE and Firefox - http://www.w3schools.com/Css/css_reference.asp

Try this demo to see it working in both browsers -
http://www.w3schools.com/Css/tryit.asp?filename=trycss_overflow




scroll add to div control
priya s replied to mv ark on 08-May-09 07:21 AM

Hi,

<div id="divSummary" style="width: 700Px; height: 400Px; overflow-y: auto; overflow-x: hidden"

runat="server">

</div>

Hope this help u.

solution :: how to add scrollbar to div tag
DC RC replied to theiry henry on 09-May-09 12:04 AM
Try This,

Have a div with a specified height and width and set the CSS overflow property to "scroll". Like this:


<div style="
width: 160px;
height: 250px;
overflow: scroll;">Your links.</div>

Note: in XHTML the style attribute is deprecated. Use a style tag or a style link instead, to be forward-compatible.


Thank You
help
how to keep scrollbar for repeater in asp.net? Place repeater control inside a div tag <div style = "width:980px; overflow:scroll; height:500px"> <repeater> < / div> You need to keep the repeater control inside a div tag, which will add the scroll bar to the repeater control. Check the below link samples http: / / www.dotnetspider.com / resources / 2301-Scrollable-Repeater-control-with-fixed-column-Header-Auto-Scrollbar.aspx Try like this- put your repeater control inside div. <div style = "width: 200px; height
Oct-12 07:49 PM How can I hide scrollbars which appear in my floating div element with CSS property? add the attribute in the css class for div overflow:hidden; You shouldn't get both horizontal and vertical scrollbars unless you make the content proposed CSS3 extension to set scrollbars independently, which you could use to suppress the vertical scrollbar: overflow : auto ; overflow-y : hidden ; You may also need to add for IE8: -ms-overflow-y : hidden ; as Microsoft are threatening to move all pre-CR-standard properties into their other hand it's entirely possible IE8 will have fixed the bug anyway. By setting overflow:auto in style property of Div. you can do this- <div id = "floating-div" style
how maintain scroll of <div> ASP.NET 28-Oct-12 07:42 PM hi friends I using <div> with overflow = auto; but when i select the item on div, scroll is reset and showing 1st item, i want stop reset of scroll or again gain that scroll focus, so that item from div it show selected / current item, any help, pls hi, Try using panel instead of div and set panel ScrollBar property to "Vertical", which will display only verical scroll bar. < asp:Panel ID = "panel1" runat asp:Panel > hope this will help you not this, i want maintain scroll position of div on postback Hi, for this i have three solutions for you one way to handle
in checkboxlist. . . Simply put ur checkboxlist in a division like this with fixed hieght and overflow sett to auto: <div style = "height:100px;overflow:auto;"> <asp:CheckBoxList> < / asp:CheckBoxList> < / div> Just place your controls within the diiv tag to get a scrollbar. <DIV style = "OVERFLOW-Y:scroll; WIDTH:760px; HEIGHT:570px DIV> Also check out http: / / www.dotnetjohn.com / articles / articleid98.aspx OVERFLOW-Y is not exists
Hi, what are the scrollbar css properties, that are supported by the firefox browser. can any one help me please advance. regards, shajahan. You want to change apply CSS in your textarea or whole DOCUMENT scrollbar ???? Hi, i want apply the scrollbar styles for division areas. Hello, use following code and let me know weather its working or not. overflow :-moz-scrollbars-horizontal; or overflow :-moz-scrollbars-vertical; Thank you hi, Set the overflow property to scroll: div { width:150px; height:150px; overflow:scroll; } The overflow property specifies what happens if content overflows
0; padding:0;} #outer_container{margin:0; width:326px; padding:0; } #customScrollBox{position:relative; height:200px; overflow:hidden;} #customScrollBox .container{position:relative; width:295px; top:0; float:left;} #customScrollBox .content{clear:both text / javascript" src = "jquery.mousewheel.min.js"> < / script> < / head> <body> <form id = "form1" runat = "server"> <div id = "main_wrapper"> <div id = "top_wrapper"> <div class = "logo_container"> <a href = "index.html" style = "border: none;"> <img src = "images / logo_keybiz.jpg" / > < / a> < / div> <div class = "top_slogan"> A B2B and B2C Facilitation Portal div> <div id = "top_link"> <ul> <li> <a href = "Index.aspx"> Home< / a> < / li> < / ul> < / div> <div id
when iam trying to keep overflow scroll in div tag then iam getting scroll to div tag not in listbox? <div id = 'hello' style = "Z-INDEX: 102; LEFT: 13px; OVERFLOW: auto; WIDTH: 247px; POSITION: absolute; TOP: 62px; HEIGHT: 134px" > Put your listbox here div> <p> <div style = " overflow:auto; width: 215px; height: 68px" > <asp:ListBox ID = "ListBox1" runat = "server" > <asp:ListItem
how t avoid scroll bar in inner listbox. . . . .by using div iam getting another vertical scroll bar Hello Set overflow-y : hidden ; property as follows < div style = " width : 90px ; overflow-x : auto overflow-y : hidden ; "> iam just seeing oveflow property in div style not overfloe - x and y. . . . . . Just do it like below code <div style = "overflow:auto; width:400px; height:300px" > <asp:ListBox ID = "ListBox3" runat = "server" Height = "100%
Hi, I am want to position my div blocks on page. I am using below code < body > < div style = "position:absolute; width:90%;"> < div style = "position:relative; float:top; border:solid 1px black;"> Below Top with full width div > < form id = "form1" runat = "server"> < div style = "position:relative; float:top; border:solid 1px black;"> Top full width < / div > < div style = "position:relative; float:right; border:solid 1px black;"> right bottom < / div > < div style = "position