tags:

views:

133

answers:

2

I have a frame that has scrolling disabled, I need to enable this through javascript. I can get the frame in the DOM using

frame = top.frmMain.id;

I'm struggling to work out how to then turn on scrolling. Its probably something really simple that I am missing. I guess I need to remove the scrolling=no attribute, any pointers would be great.

Thanks

A: 

You want overflow:scroll (both scroll bars) or overflow:auto (only the needed scroll bar and only if needed - preferred by me)

Crimson
I need overflow:auto. It's currently just set on the frame to scrolling=no
Gavin Draper
A: 
frame.setAttribute('scrolling', 'auto');

or

frame.setAttribute('scrolling', 'yes');

should do the trick.

Øystein Riiser Gundersen
I don't know if the `scrolling` attribute overrides the `style` attribute or the other way around, but the style can be set using `frame.style.overflow = 'auto';`
Øystein Riiser Gundersen