rupes0610
rupes0610

Reputation: 271

Keep original page position when opening new window

I have a hotspot map of our office. The hotspots can be clicked and a small window pops up but the larger page with the map moves back to its original position. How can I get my larger map page to stay in the same position in the browser?

<html>
<title>Office Map</title>


<div>
<img src="Office.jpg" width="2550" height="1650" usemap="#Map" class="mapper">
</div>

<map name="Map">
<!--MKTP51-->
<area shape="rect" title="MKTP51"   coords="1856,391,1874,420" alt="MKTP51" a href="#" onClick="window.open('PrinterPages/mktp51.html','mywindow','width=400,height=200,toolbar=no,location=no,directories=no,statu s=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no')">
<!--MKTP40-->  
<area shape="rect" title="MKTP40"   coords="772,322,790,358"   alt="MKTP40" a href="#" onClick=    "window.open('PrinterPages/mktp40.html','mywindow','width=400,height=200,toolbar=no,location=no,directories=no,statu s=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no')">

Thank you in advance.

Upvotes: 0

Views: 350

Answers (1)

freefaller
freefaller

Reputation: 19963

Try putting return false; at the end of the onclick attribute. (Note, you will need to put a ; at the end of the current statement)

That should stop the standard link processing, and stop it going to the start of the page due to the href="#"

Just to confirm, the endof the onclick attribute should be something like...

... resizable=no'); return false;">

Upvotes: 1

Related Questions