PDA

View Full Version : [Q] How to make the image clickable


CyanBlue
11-20-2006, 10:20 PM
I am laying out the buttons in HTML file...
<div id="nextActive" name="nextActive" class="active"><a href="javascript:goNext();"><em>N</em>ext</a></div>
<div id="nextFlash"><a href="javascript:goNext2();"><em>N</em>ext</a></div>
and I positioned those two layers into the exactly the same area in the CSS file because what I want to is to make the next button flash when it needs to be...

I have a JavaScript function that hides the normal next image file and displays the animated gif file for the nextFlash layer...
var style1 = document.getElementById('nextActive').style;
style1.display = "none";
var style2 = document.getElementById('nextFlash').style;
style2.display = "block";
It does the job but the problem is that I cannot make that animated gif image in the nextFlash layer clickable to execute the goNext2() function...

I see the image blinking but I cannot click it... Anybody know what I am missing??? :(

sfhazel
11-27-2006, 06:01 AM
Could you post a bit more of your code. I am trying to replicate your setup to test this out, but I'm stuck when it comes to your gif file. Can you post your code for your goNext and goNext2 functions?

Although I'm not 100% sure what you're asking here, have you tried using the innerHTML method in your Javascript? For instance:

var myDiv= document.getElementById('myDiv');
myDiv.innerHTML = "<a href='http://www.google.com'><img src='blink.gif' /></a>";

CyanBlue
11-27-2006, 02:07 PM
I did what I could with my limited JS knowledge which includes defining the innerHTML and whatnots, but I was not able to get it to work...
A funny thing is that my sample code does the job but as soon as I apply the same logic into the work file, it stops working... I am going to try to create a sample file out of the actual work file and see if I can post it later this week... This stuff does not have highest priority, so I can't work on it right at the moment though... Thanks... ;)