Link to home
Start Free TrialLog in
Avatar of VapiSoft
VapiSoft

asked on

add vertical scroller to ul

Hi,
I have a pge with.
I want to add a verical scrollbar to it.
obj.style.overflowY='auto';
to the ul, and to the div but it didn't work.
<div>
  <ul>
    <li>aaa</li>
    <li>bbb</li>
  </ul>
</div>
Avatar of Marco Gasi
Marco Gasi
Flag of Spain image

You can add with simple css rule

ul{overflow:auto;}

This wll make a vertical scrollbar appear if needed.

Cheers
Avatar of Proculopsis
Proculopsis


Try something like:

<div style="height: 100px; width: 150px; overflow-x: auto;">
  <ul>
    <li>aaa</li>
    <li>bbb</li>
    <li>ccc</li>
    <li>ddd</li>
    <li>eee</li>
    <li>fff</li>
    <li>ggg</li>
    <li>hhh</li>
    <li>iii</li>
    <li>jjj</li>
    <li>kkk</li>
  </ul>
</div> 

Open in new window

Avatar of VapiSoft

ASKER

I can't do it bacause it is somehing that is generated from jQuery.

But evn if I find a way to do it, I think it will not help because as I wrote, I changed it from Javascript to tyle.overflowY='auto' and it didn't help (it did not add the scrollbar).
ASKER CERTIFIED SOLUTION
Avatar of Proculopsis
Proculopsis

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In my code it worked with overflow-y