|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have an Image map with quite a few hotspots which all have an OnClick event.
When I first click on a hotspot the OnClick event triggers, but after that it seems like it doesn't trigger the event unless I click on some whitespace outside the image. I tried to to add a imagemap.blur() to the js code, which improves the way it works but it still doesn't work every time. Any help/advise would be appreciated, Thanks, Kelvin |
|
#2
|
|||
|
|||
|
Lets have a look at that code, please. ![]() |
|
#3
|
|||
|
|||
|
You asked 4 it;
<HTML> <HEAD> <META http-equiv="Content-Style-Type" content="text/css"> <LINK type="text/css" rel="stylesheet" href="/css/normal.css" TITLE="Normal Style Sheet"> <STYLE> #auc-box{POSITION: absolute; VISIBILITY: hidden; TOP: 50px; LEFT: 2px; } #cred-box{POSITION: absolute; VISIBILITY: hidden; TOP: 50px; LEFT: 2px; } #faq-box{POSITION: absolute; VISIBILITY: hidden; TOP: 50px; LEFT: 2px; } #intro-box{POSITION: absolute; VISIBILITY: hidden; TOP: 50px; LEFT: 2px; } #neg-box{POSITION: absolute; VISIBILITY: hidden; TOP: 50px; LEFT: 2px; } #news-box{POSITION: absolute; VISIBILITY: hidden; TOP: 50px; LEFT: 2px; } #press-box{POSITION: absolute; VISIBILITY: hidden; TOP: 50px; LEFT: 2px; } #prof-box{POSITION: absolute; VISIBILITY: hidden; TOP: 50px; LEFT: 2px; } #rec-box{POSITION: absolute; VISIBILITY: hidden; TOP: 50px; LEFT: 2px; } #who-box{POSITION: absolute; VISIBILITY: hidden; TOP: 50px; LEFT: 2px; } #wtb-box{POSITION: absolute; VISIBILITY: hidden; TOP: 50px; LEFT: 2px; } #wts-box{POSITION: absolute; VISIBILITY: hidden; TOP: 50px; LEFT: 2px; } #trad-ul{POSITION: absolute; VISIBILITY: hidden; TOP: 16px; LEFT: 225px; } #mw-ul{POSITION: absolute; VISIBILITY: hidden; TOP: 16px; LEFT: 370px; } #ser-ul{POSITION: absolute; VISIBILITY: hidden; TOP: 16px; LEFT: 506px; } #about-ul{POSITION: absolute; VISIBILITY: hidden; TOP: 16px; LEFT: 638px; } </STYLE> <SCRIPT LANGUAGE="javascript"> <!-- var layerStyleRef=""; var layerRef=""; var styleSwitch=""; var layershow="", layerhide=""; var imageon="off"; var ulon="off"; function init(){ if (navigator.appName == "Netscape") { layerStyleRef="layer."; layerRef="document.layers"; styleSwitch=""; layershow="show"; layerhide="hide" }else{ layerStyleRef="layer.style."; layerRef="document.all"; styleSwitch=".style"; layershow="visible"; layerhide="hidden"; } } function showlayer(easy, ul) { if(imageon != "off") { eval(layerRef+'["'+imageon+'"]'+styleSwitch+'.visibility="' + layerhide + '"'); } if(easy != "off") { eval(layerRef+'["'+easy+'"]'+styleSwitch+'.visibility="' + layershow + '"'); } if(ulon != ul && ulon != "off" && ul!="off") { eval(layerRef+'["'+ulon+'"]'+styleSwitch+'.visibility="' + layerhide + '"'); eval(layerRef+'["'+ul+'"]'+styleSwitch+'.visibility="' + layershow + '"'); } if(ul == "off" && ulon != "off") { eval(layerRef+'["'+ulon+'"]'+styleSwitch+'.visibility="' + layerhide + '"'); } if(ulon == "off" && ul != "off") { eval(layerRef+'["'+ul+'"]'+styleSwitch+'.visibility="' + layershow + '"'); } ulon = ul; imageon = easy; } //--> </SCRIPT> </HEAD> <BODY OnLoad="javascript:init();"> <!-- Corner images which change //--> <DIV ID="auc-box"> <IMG SRC="/images/itxmarket/popup/auc-box.gif"> </DIV> <DIV ID="cred-box"> <IMG SRC="/images/itxmarket/popup/cred-box.gif"> </DIV> <DIV ID="faq-box"> <IMG SRC="/images/itxmarket/popup/faq-box.gif"> </DIV> <DIV ID="intro-box"> <IMG SRC="/images/itxmarket/popup/intro-box.gif"> </DIV> <DIV ID="neg-box"> <IMG SRC="/images/itxmarket/popup/neg-box.gif"> </DIV> <DIV ID="news-box"> <IMG SRC="/images/itxmarket/popup/news-box.gif"> </DIV> <DIV ID="press-box"> <IMG SRC="/images/itxmarket/popup/press-box.gif"> </DIV> <DIV ID="prof-box"> <IMG SRC="/images/itxmarket/popup/prof-box.gif"> </DIV> <DIV ID="rec-box"> <IMG SRC="/images/itxmarket/popup/rec-box.gif"> </DIV> <DIV ID="who-box"> <IMG SRC="/images/itxmarket/popup/who-box.gif"> </DIV> <DIV ID="wtb-box"> <IMG SRC="/images/itxmarket/popup/wtb-box.gif"> </DIV> <DIV ID="wts-box"> <IMG SRC="/images/itxmarket/popup/wts-box.gif"> </DIV> <!-- Underlines //--> <DIV ID="trad-ul"> <IMG SRC="/images/itxmarket/trad-ul.gif"> </DIV> <DIV ID="mw-ul"> <IMG SRC="/images/itxmarket/mw-ul.gif"> </DIV> <DIV ID="ser-ul"> <IMG SRC="/images/itxmarket/ser-ul.gif"> </DIV> <DIV ID="about-ul"> <IMG SRC="/images/itxmarket/about-ul.gif"> </DIV> <!-- Underlines //--> <img src="/images/itxmarket/navvy-nunu.jpg" name="wuapno" width="900" height="74" usemap="#itxmarketnav" border="0"> <!-- IMAGEMAP (Where problem Occurs in MAC //--> <map name="itxmarketnav"> <area shape="rect" coords="1,1,222,34" href="/index.html" target="content" alt="ITX market HP" title="ITX market HP" OnClick="showlayer('off', 'off');"> <area shape="rect" coords="162,54,252,66" href="/logout.pl" target="content" alt="Logout/Login" title="Logout/Login" OnClick="showlayer('off', 'off');"> <area shape="rect" coords="264,30,367,42" href="/user.pl/wants" target="content" alt="Want to Buy" title="Want to Buy" OnClick="showlayer('wtb-box', 'trad-ul');"> <area shape="rect" coords="264,41,367,53" href="/user.pl/has" alt="Want to Sell" title="Want to Sell" target="content" OnClick="showlayer('wts-box', 'trad-ul');"> <area shape="rect" coords="264,52,367,65" href="/auction.pl" alt="Online Auctions" title="Online Auctions" target="content" OnClick="showlayer('auc-box', 'trad-ul');"> <area shape="rect" coords="387,30,513,42" href="/negotiations.pl" alt="My Negotiations Account" title="My Negotiations Account" target="content" OnClick="showlayer('neg-box', 'mw-ul');"> <area shape="rect" coords="387,41,513,54" href="/user.pl/profile" alt="My Profile Settings" title="My Profile Settings" target="content" OnClick="showlayer('prof-box', 'mw-ul');"> <area shape="rect" coords="543,31,665,42" href="/insurance.pl" alt="Credit Insurance" title="Credit Insurance" target="content" OnClick="showlayer('cred-box', 'ser-ul');"> <area shape="rect" coords="543,41,594,53" href="/news.html" alt="Latest News" title="Latest News" target="content" OnClick="showlayer('news-box', 'ser-ul');"> <area shape="rect" coords="543,52,644,65" href="/recruitment.pl" alt="Recruitment" title="Recruitment" target="content" OnClick="showlayer('rec-box', 'ser-ul');"> <area shape="rect" coords="681,30,778,42" href="/introduction.html" alt="Introduction to ITX" title="Introduction to ITX" target="content" OnClick="showlayer('intro-box', 'about-ul');"> <area shape="rect" coords="681,41,725,53" href="/faq.html" alt="FAQ" title="FAQ" target="content" OnClick="showlayer('faq-box', 'about-ul');"> <area shape="rect" coords="681,52,764,64" href="/contact.html" alt="Who's who at ITX" title="Who's who at ITX" target="content" OnClick="showlayer('who-box', 'about-ul');"> <area shape="rect" coords="681,64,774,74" href="/press/index.html" alt="Press Room" title="Press Room" target="content" OnClick="showlayer('press-box', 'about-ul');"> </map> </BODY> </HTML> |
|
#4
|
|||
|
|||
|
Yipes. The only thing that I can think of off the top of my head is that you might want to make sure your variables are reset each time you call ShowLayer. Perhaps some bit is not flipped the way you think. Weird. Does it only happen on MacOS, not PC or whatever? |
|
#5
|
|||
|
|||
|
Yeah, only on the MAC.
On a PC everything works the way it should on IE and on Netscape! In fact this problem only occurs in Netscape on the MAC, unfortunately nothing happens at all on the IE 4.5 on the MAC! And also, I believe that it's nothing to do with the variables! As it doesn't even run through the function if the image map has focus(). [This message has been edited by releasedj (edited September 22, 2000).] |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > OnClick problem with Imagemap and MAc OS |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|