Forum Moderators: open

Message Too Old, No Replies

Want to add a delay to my rollovers

         

Powdork

7:49 am on Oct 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am using some js to have images of a region show in a different table cell when I rollover the name of a region on a map in the originating cell. Currently, it's way to jumpy so I want to add a short delay.
Here is the code in the head of my page

<script language='javascript'>

var xx = new Image();
var xxx = new Image();

xx.src = "xx.gif";
nothing.src = "blank.jpg";
xxx.src = "xxx.gif";

function doButtons(picimage) {
eval("document['picture'].src = " + picimage + ".src");

}// End -->
</script>
How can I best add the delay?

Sinner_G

8:37 am on Oct 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try including this into your function:

setTimeout("doButtons()", 1000);

Powdork

8:54 am on Oct 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



setTimeout("doButtons()", 1000);
Thanks:), now I'll go tweak the 1000 thingy. Any other cool effects; fade, dissolve,.. stuff like that I should know about.

Sinner_G

9:20 am on Oct 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think there are ways to fade a colour into another using the colour codes, but I guess what you want is to fade an image. Don't think this can be done (except by replacing your image with an animation).

TGecho

2:40 pm on Oct 7, 2003 (gmt 0)

10+ Year Member



Unless you want to use proprietary IE filters [webmasterworld.com]...

Powdork

4:53 pm on Oct 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK, last night I thought I had it, but it's not slowing it down. Where in the function do I put
setTimeout("doButtons(picimage)", 1000);