Closed Thread Icon

Topic awaiting preservation: HELP! Project Due Tomarow! (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8443" title="Pages that link to Topic awaiting preservation: HELP! Project Due Tomarow! (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: HELP! Project Due Tomarow! <span class="small">(Page 1 of 1)</span>\

 
Skatefx
Bipolar (III) Inmate

From: Small Patch of Grass in CT
Insane since: Mar 2001

posted posted 12-16-2002 03:19

Ok i'm freaking out because I set up a script to work in unison with an image map. When I did exactly that (as seen here) it worked fine the descriptions popped up in a little box near arrow. When I inserted the image map into a table the description box suddenly moved far away from the arrow (as seen here). How do I fix the script to make the description box position right near the arrow? My project is due in the morning and I dont know what to do!

+ Mike +

reitsma
Maniac (V) Mad Scientist

From: the bigger bedroom
Insane since: Oct 2000

posted posted 12-16-2002 03:36

the popup position is created according to the sitemap object position - so if the bit that is 100 pixels across on the image is mouseovered, the little popup pops up 100 pixels across on the page.

these two lines look after that:

code:
document.tooltip.left=e.pageX+14
document.tooltip.top=e.pageY+2



the "+14" and "+2" can shift it around on the page, but this won't actually help you, as you have the image centred. this means that the image is not actually at a fixed position on the page - it just depends on how wide the viewer's browser is.

as i see it, you have two options:

1) make the image left aligned, and then adjust the '14' and '2' to make the stuff pop up where it should.

2) make the popup generate according to where the mouse is, instead of where the image map element is. Something like this should put you well on your way to achieving that.

good luck.


Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 12-16-2002 04:09

With all due respect, I'm not sure Rietsma is right: pageX and pageY should actually give you the exact location of the mouse. I think that part is right. In any case, that's just the NN4 part, and I didn't test it in NN4.

To fix it for IE and Mozilla, if you change the two lines

elm.style.top=parseInt(elml.offsetTop+elml.offsetHeight)
elm.style.left=parseInt(elml.offsetLeft+elml.offsetWidth+10)

to

if (typeof(e)=='undefined') event = e; // makes mozilla work
elm.style.top=(event.clientY + 14) + 'px';
elm.style.left=(event.clientX + 2) + 'px';

then that should work as expected. (note that typeof(e)=='undefined' isn't the best way to check whether or not e is defined; but i'm not really sure what is and that works fine.) The 'px' isn't necessary, but it's good coding practice to assign style properties just like you would if you were writing the CSS itself.

reitsma
Maniac (V) Mad Scientist

From: the bigger bedroom
Insane since: Oct 2000

posted posted 12-16-2002 06:14

listen to slime - i only had a quick look, and made assumptions.

sorry 'bout that.

genis
Paranoid (IV) Inmate

From: Dallas, TX
Insane since: Aug 2002

posted posted 12-16-2002 08:56

in this forum... everyone listens to slime.

Skatefx
Bipolar (III) Inmate

From: Small Patch of Grass in CT
Insane since: Mar 2001

posted posted 12-16-2002 15:20

Thanks a million guys! It all worked out and I just presented it. They loved it!

+ Mike +

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 12-16-2002 19:03

Glad to hear it, congrats!

. . : slicePuzzle

« BackwardsOnwards »

Show Forum Drop Down Menu