Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 31, 2026.

Div positioning

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

PoorDoggie

Soon to be RICHdoggie!VIP Member
Impact
18
Hi. I am just learning about divs and DHTML and stuff, and was in the middle of making a menu system for a new site I am making, and I wondered if you could help me with something.

This menu is going to be dynamic. I want to be able to add and remove items on it with php and mysql, so I never know how far down a menu item is.

What I need is some javascript (or php) that will get the "right" value of a div and the "bottom" value of div (or the height and width).

This way I can calculate the next one down etc.

Thanks
Tom
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
This may or may not help but I have (I got the css somewhere & tweeked to my needs) a menu which I include via PHP.
Site = http://www.rosevillepottery.info this system well but needs some messing with to function in IE -- what else is new (yuck)!!

The include test is at http://www.rosevillepottery.info/menu-test.htm note the image moves up & down when menu contracts or expands.

NOTE the image in my example or whatever content follows the menu must be included in the div. If it follows it will be ptlaced by default relative to the div.

Hope helps get you going.

This is required for IE to work here.
Code:
<SCRIPT> startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}
window.onload=startList;</SCRIPT>
 
Last edited:
0
•••
0
•••
the scripts used at dhtmlcentral are provided free on the site, why dont you get it from there?
 
0
•••
because I want my menu to be dynamic. Theirs all the menu items are fixed! :)

While we are on the subject of positioning <div>s I was wondering if there is any way to position it relative to the bottom of the browser window? And is there any way to find out how wide the visitor's browser is? I have all these flashy things on my page with divs and I can never get it right on all browsers.

Another thing, which is really annoying with "alsolute" positioned divs is that it dosen't hold any weight in the layout of the site. I have these movable div's and the footer is connected to the header still:

HTML:
<table><tr><td>HEADER<\td><\tr><\table>
<div style="width:600px;height:800px;position:absolute;">Main Content</div>
<table><tr><td>FOOTER<\td><\tr><\table>

Is there any way to make the divs push the footer down?
 
0
•••
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

New in Parking: updated way to act on many domains or inquiries at once
Your domain list and inquiry list now have a bar above and below the list. Check the items you want, then choose an action in the bar...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back