SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
Thread: two mouseover events
-
Sep 2, 2001, 07:18 #1
- Join Date
- Jun 2001
- Location
- London
- Posts
- 423
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
two mouseover events
Hi,
Can anyone think of how to cause two mouseover events to occur.
Basically I have a rollover effect that I would like to cause a hidden layer to become visible (currently I have this as a click event)?
any ideas?
-
Sep 2, 2001, 07:52 #2
- Join Date
- May 2001
- Location
- Channel Islands Girth: Footlong
- Posts
- 5,882
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You can do it using with a little tweaking of the trusty swapimagerestore script.
PHP Code:
<head>
<script language="javascript">
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
</head>
<BODY>
<IMG SRC="hiddenimage.gif" NAME="image" />
<a href="thelink.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image','','image.gif','image2','','image2_on',1)">
<img src="image2_off.gif" border="0" name="image2" /></a>
that should work...Last edited by weirdbeardmt; Sep 2, 2001 at 07:58.
I swear to drunk I'm not God.
» Matt's debating is not a crime «
Hint: Don't buy a stupid dwarf ö Clicky
-
Sep 2, 2001, 07:59 #3
- Join Date
- May 2001
- Location
- Channel Islands Girth: Footlong
- Posts
- 5,882
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
for some reason the last post is refusing to render correctly, now matter how i edit it!
anyway, the very last line should read
<img src="image2_off.gif" name="image2"></A>I swear to drunk I'm not God.
» Matt's debating is not a crime «
Hint: Don't buy a stupid dwarf ö Clicky
-
Sep 4, 2001, 08:34 #4
- Join Date
- Jun 2001
- Location
- London
- Posts
- 423
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
missing parts
Thanks for the posting but am unable to read the beginning section.
cheers
-
Sep 4, 2001, 08:39 #5
- Join Date
- Jun 2001
- Location
- Toronto, Canada
- Posts
- 9,123
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
onMouseOver="doThing();doThing2"
-
Sep 4, 2001, 09:09 #6
- Join Date
- Jul 2001
- Location
- Scotland
- Posts
- 4,836
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
damn, sunny beat me
Bookmarks