what if I wanted the div tags to display side by side and move to the next line if the page is resized as it currently does with float:left
I dont want to get tied in to using absolute positions
Main Topics
Browse All TopicsHi
I have numerous floating div tags using <div style="float:left;"></div>
Now I want to use javascript to onmouseover to enlarge one of these div tags but for it not to move any of the other div tags beside it. So this div tag goes over the other tags.
Thanks
Adam
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Well I cant really think of any simple ways of doing it... You are asking for two conflicting properties to apply at the same time. Float means that each object is aware of the previous objects position... If you change one, then the other has to change as well... Then you want to be able to modify that object without the others noticing... Which is not going to happen.
I suppose however that you could use a combination of the two, for instance...
Create one set of blank div layers that float:left, like so :
<div id="float1" style="float:left; width:100px;"></div>
<div id="float1" style="float:left; width:100px;"></div>
<div id="float1" style="float:left; width:100px;"></div>
Now create another set of div layers that hold your actual content, and position them absolutely.
<div id="absolute1" style="position: absolute; width:100px;"></div>
<div id="absolute2" style="position: absolute; width:100px;"></div>
<div id="absolute3" style="position: absolute; width:100px;"></div>
Next thing you want to do is create a javascript function that will move the second set of div layers onto the top of the first div layers... Here is some sample code : (Not tested)
<script language="javascript">
function getobject(obj) {
if (document.getElementById)
return document.getElementById(ob
else if (document.getElementByName
return document.getElementByName(
else if (document.all)
return document.all[obj]
}
function findx(obj) {
var curleft = 0;
if(obj.offsetParent) {
while(1) {
curleft += obj.offsetLeft;
if(!obj.offsetParent) {
break;
}
obj = obj.offsetParent;
}
} else if(obj.x) {
curleft += obj.x;
}
return curleft;
}
function findy(obj) {
var curtop = 0;
if(obj.offsetParent) {
while(1) {
curtop += obj.offsetTop;
if(!obj.offsetParent) {
break;
}
obj = obj.offsetParent;
}
} else if(obj.y) {
curtop += obj.y;
}
return curtop;
}
function move_layers() {
var newx;
var newy;
newx = findx(getobject('float1'))
newy = findy(getobject('float1'))
getobject('absolute1').sty
getobject('absolute1').sty
newx = findx(getobject('float2'))
newy = findy(getobject('float2'))
getobject('absolute2').sty
getobject('absolute2').sty
newx = findx(getobject('float3'))
newy = findy(getobject('float3'))
getobject('absolute3').sty
getobject('absolute3').sty
}
</script>
Then execute move_layers(); on body onLoad, or something... i.e.
<body onLoad="move_layers();">
Hope that helps.
Business Accounts
Answer for Membership
by: cnelissenPosted on 2007-08-28 at 09:32:17ID: 19784633
they need to be positioned absolutely, rather than floated... Float by its very nature, means that they stack next to each other, if one changes, they all change...
Something like this is what you should do:
<div style="position: absolute; x: 100px;"></div>
<div style="position: absolute; x: 150px;"></div>
<div style="position: absolute; x: 200px;"></div>
and so on.