HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 21st, 2000, 05:30 AM
releasedj releasedj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: London
Posts: 46 releasedj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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

Reply With Quote
  #2  
Old September 21st, 2000, 11:19 AM
JSchoof JSchoof is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Posts: 82 JSchoof User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 23 m 46 sec
Reputation Power: 9

Lets have a look at that code, please.

Reply With Quote
  #3  
Old September 21st, 2000, 12:01 PM
releasedj releasedj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: London
Posts: 46 releasedj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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>

Reply With Quote
  #4  
Old September 21st, 2000, 02:55 PM
JSchoof JSchoof is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Posts: 82 JSchoof User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 23 m 46 sec
Reputation Power: 9

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?

Reply With Quote
  #5  
Old September 22nd, 2000, 03:41 AM
releasedj releasedj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: London
Posts: 46 releasedj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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).]

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > OnClick problem with Imagemap and MAc OS


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT