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