homepage Welcome to WebmasterWorld Guest from 54.237.38.30
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / WebmasterWorld / New To Web Development
Forum Library, Charter, Moderators: brotherhood of lan & mack

New To Web Development Forum

    
I need to create a onMouseOver that will change gif's randomly
New to web programming
hogman

10+ Year Member



 
Msg#: 208 posted 8:15 pm on Dec 11, 2002 (gmt 0)

I would like to create a onMouseOver that will display a different image on each mouseover and change to the default onMouseOut

 

korkus2000

WebmasterWorld Senior Member korkus2000 us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 208 posted 8:19 pm on Dec 11, 2002 (gmt 0)

Welcome to WebmasterWorld hogman,

You want to have a rollover button that when you rollover it, it will chose a random image to swap, then switch back to the original?

hogman

10+ Year Member



 
Msg#: 208 posted 8:27 pm on Dec 11, 2002 (gmt 0)

Yes that is exactly what I am looking for.

BjarneDM

10+ Year Member



 
Msg#: 208 posted 10:32 pm on Dec 23, 2002 (gmt 0)

<html>
<head>
<script type="text/javascript" language="Javascript">
var images = new Array ()

images[images.length] = '<URL for img1>'
images[images.length] = '<URL for img2>'
...
images[images.length] = '<URL for imgN>'

function randomised(toChange)
{
toChange.src = images[Math.floor(Math.random()*images.length)]
}
</script>
</head>
<body>
<img src="<img-file>" alt="" onmouseover="randomised(this)" onmouseout="this.src='<img-file>'">
</body>
</html>

Simple :-)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / New To Web Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved