Jump to content

List boxes and changing width.


eva21

Recommended Posts

I need some major help on this so any input would be greatly appreciated. I have the following list box:

echo("<Select size=3 MULTIPLE style='width: 235px; font-size: 9pt;' onMouseover='changeWidth(" . $rows['id'] . ")' onMouseout='changeWidthBack(" . $rows['id'] . ")' onchange='getMedia(" . $rows['id'] . ")' name='" . $rows['id'] . "_t[]' id='" . $rows['id'] . "_t'>");

 

And I have the following JS functions:

function changeWidth(x)

{

document.getElementById(x + '_t').style.width = '';

}

function changeWidthBack(x)

{

document.getElementById(x + '_t').style.width = 235 + 'px';

}

 

Everything works fine, it grows a bit bigger so I can actually see the whole setence. Except it completely wrecks my table and I was wondering if there is a way to expand this list box using mouse over without wrecking my design? Please any examples or thoughts would be great thanks!

Link to comment
https://forums.phpfreaks.com/topic/159206-list-boxes-and-changing-width/
Share on other sites

Sorry no i dont have an example.

 

It grows with the list box. For example I have a long setence and it makes the cell grow which makes the table itself expand. I just want some way to keep it from growing, but be able to make the list box bigger so the user can see the whole setence. If this is possible i am hoping. I was thinking of forcing the <td> to be one size regardless of how big the list box grows? Not sure if that would be good or not.

tried overflow: hidden; on the set width td to hide it

or overflow: auto; to make it add a scrollbar if they content is 'too wide'.

 

Although I do remember this not working like I wanted it to, so you might have to add display: block;... or simply add a div with the width inside the table cell with the overflow.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.