Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

how to Auto Resize / Move a control onFocus

Avatar of ntrivett
ntrivett asked on
3 Comments1 Solution1047 ViewsLast Modified:
I am using a grid to display several columns of data. In one of the columns I have a drop-down list. My problem is that the column is not wide enough to display the contents in the drop-down list.

I would therefore like to resize/move the drop-down when it gets focus (i wish to expand it to the left), and then return it to its original size/position when it loses focus.

I have tried wrapping the control in a div and set the positioning etc of the div to absolute to get the thing to move, but I am having difficulty writing script that actually works. Also, wrapping the control in a div (before I start messing with it's position etc) immediately causes the wrapped control to appear vertically indented (i.e. it no longer lines up with the rest of the controls on the row in question).

Can anyone suggest a neat pair of functions I can call via the onFocus/onBlur events that will achieve this goal?
Avatar of devic
devicFlag of Germany image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answers