Click to See Complete Forum and Search --> : Dynamically lining up layers


Druid
01-10-2003, 05:04 PM
First off, my test page is here: http://www.deltaaudio.com/temp/theone.html

On the page is a nav bar. I then have two layers which i want to line-up with said nav bar. Since the site uses liquid

design, the nav bar will not be displayed at a constant position, and hence i cannot assign a definite position to

the two layers (they show the nav 2 for two items in the nav bar on the page).

Now, i've managed to get everything working beautifully in IE, but NN 4.7 & 6.2 declares that the object i'm passing

"is not defined".

I'm not a coder as such, so i've cobbled together scripts from (http://www.webreference.com/js/column33/) and

Dreamweaver.

It's probably easier for you to have a look at the actual page than for me to try to explain it here. But the crux of

my problem seems to be when NN gets into the second line of the following function.


function ax_getImageXfromLeft(imgID) {
if (NS4) return eval(imgID).x
else return ax_getRealLeft(imgID);
}


The Java console reports:

JavaScript Error:
http://www.deltaaudio.com/temp/theone.html, line 42:
serv is not defined.

I know it's got to be a simple solution, but it's beyond my current knowledge, so if anyone can offer any assistance i'd appreciate it, and be able to stop pulling my hair out in frustration!

Thanks

Druid

Druid
01-10-2003, 10:44 PM
"that will only work if the IMG is not within another container object"
"For NS4, the only solution is to get the correct qualified object reference."

Uhhh... I have no idea what you're saying here. (Like i said, i'm a terrible coder with little to no javascript knowledge.)

Serv comes from the following:

<img src="images/n1_services_off.gif" name="serv" width="162" height="21" border="0" id="serv">
and is within a table on the base page (ie not a layer).

And i've tried each suggestion
http://www.deltaaudio.com/temp/docimg.html
http://www.deltaaudio.com/temp/getbyid.html

but still no joy in either NN 4.7 or 6.2

Now, if my code is unfixable and there is an alternate way of doing things, i'm completely open to it. This is obviously all code in development, nothing i'm locked into.

Anyway, yeah, i'm not sure whether the table is considered another container, and/or what the correct qualified object reference would be i have no idea.

Help!

Druid
01-11-2003, 06:16 PM
Indeed, docimg.html returns no console errors. But then again, the layers are not lined up as you also pointed out.

Bring on the solution to fix all my woes. (Well, at least my JS woes!) I wait in antici.....*pation*.

Druid
01-11-2003, 08:37 PM
The reason is, the image in question is part of a nav bar. This nav bar will appear at a variety of x and y co-ords depending on the width of browser window, and the page chrome around the nav-bar. I want to reposition the layers (which show the sub-nav elements) based on the position of the nav bar.
I don't want to move the nav bar, i want it to tell the sub-nav where it is, and then have the sub-nav place itself appropriately.

Druid
01-12-2003, 08:10 AM
Yep, that's it.

This would all be a non-issue if the client wanted a nav bar on the lefthand side, but they want to be unusual/difficult. So the nav bar has to live on the right, and the site has to expand to the width of the browser window, whatever width that may be. And thus, i need to dynamically reposition the layers to the precise spot above the services image and the pfolio image.

If finding the location of a div is easier, i can put the base nav in a div tag, but i suspect working with a div or img tag to be a much of a muchness in this circumstance.

Druid
01-13-2003, 05:44 PM
Ahhhhhhhhh!

http://www.deltaaudio.com/temp/moveit.html

Thanks for your help. Managed to get things to work as i wawnted/needed them to.

If you have the time have a look at the page and let me know if any errors appear. - AFAIK it is error free in NN4.7, 6.2, 7.0, IE 5.5, 6

Thanks Dave

-your test page was pretty damn good btw-

Druid
01-13-2003, 07:26 PM
Hmmm... strange. It's just a standard roll-over, nothing different between that and the other rollovers.

Have a another look, perhaps just a once off.

Druid
01-13-2003, 09:03 PM
Hmmm... well... i've deleted & reassigned the behaviours in Dreamweaver, and uploaded the file again. - Have one last look coz i can't replicate the problem on my system.

Failing any change, i'm not going to worry about it.

Thanks for all the time you've put in tho.

D

Druid
01-14-2003, 06:53 AM
Ahhh! Lovely!