Link to home
Start Free TrialLog in
Avatar of davideo7
davideo7Flag for United States of America

asked on

How do you move a DIV relative to where it is using JavaScript?

I have a DIV element and I'd like to move it up by 90 pixels relevant to where it is.  How can this be achieved?

Here's an example of what I want:
http://www.vizzed.com/videogames/
When you hover over the game systems area (above the search box), the game system area gets bigger but I'd like for it to also move up by 90 pixels so that when it does get bigger, it only blocks out the stuff above it rather than the stuff below it.

Here's the javascript code I'm currently working with
onmouseout=\"
						document.getElementById('allSystems').style.height='74px'; 
						document.getElementById('allSystems').style.backgroundColor='transparent';\" 
					onmouseover=\"
						document.getElementById('allSystems').style.height='164px'; 
						document.getElementById('allSystems').style.backgroundColor='#6d87ac';\" 

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

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
Markup is in a bit of a mess. Using tables for layout is also adding to your problems.

If you did a standard <div> layout you could do everything you need with CSS.

First clear all the validation errors - and then consider moving away from your table layout.
Avatar of davideo7

ASKER

That worked perfectly!  And thanks for the tips.