Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Image map name to .js

Status
Not open for further replies.

cc4mail

Technical User
Jan 8, 2002
47
US
I am having trouble passing image map name (document.links[x].name) to a .js on a onMouseover event in a document with 50+ image maps. Can the array value be returned on the onmouseover event to identify the name?

Any ideas??? Many thanks.

e.g. (pass the name value to the .js file)

<area shape=&quot;rect&quot; coords=&quot;294,128,310,140&quot; href=&quot;#&quot; onMouseover=&quot;stm(Text[8],Style[0])&quot; onMouseout=&quot;htm()&quot; name=&quot;0310222222&quot;>

<area shape=&quot;rect&quot; coords=&quot;200,122,210,180&quot; href=&quot;#&quot; onMouseover=&quot;stm(Text[8],Style[0])&quot; onMouseout=&quot;htm()&quot; name=&quot;031099999&quot;>
 
untested, can you pass, this.name?

So, onMouseover=&quot;stm(Text[8],STyle[0],this.name)&quot;

hth,

Jessica [ponytails2]
 
nope, this.name is the frame name in this instance.

I wasn.t real clear on the .js file issue. the stm() references a second .js style file passing the array index values. Passing this.name to stm() is to the wrong .js file.

I'm trying to reference the image map name in a second .js files for other functions.

make sense??
 
Hmmm, I guess I'm still unclear...

What mouseover, then is calling the 2nd.js file function?

Jessica [ponytails2]
 
Do you wan't the image map name or the area name, or the position of the area in the links array? Your question seems to ask for one thing then another, then has an example of yet another. What exactly do you want returned?

[sub]Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
[/sub]
 
Yup. I'm pretty good at confusing others, as well as myself.

stm(x,y) passes to main.js.

x,y values are then obtained from an array in sub.js and passed back to main.js

the x value in sub.js is populated by this.name of the image map. (the name in the image map is dynamically produced by another application. whew!

the problem arose when the .js loaded before the mouseover, giving the frame name, not the image map name.

I think I got it solved. Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top