View Full Version : Image mouseovers
Liquor_Riss
05-26-2003, 07:13 AM
Can anyone tell me how to put a mouseover onto an image, like the links on Jamblo and Decoys sites? Thanks
zubaz
05-26-2003, 01:15 PM
you mean the fade in and fade out? Why don't you take a gander at the source buddy. It's in there, I saw it. you know, I'll even post if for ya.
[code:1]<script language="JavaScript" type="text/JavaScript">
<!--
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
/* object - image to be faded (actual object, not name);
* destop - destination transparency level (ie 80, for mostly solid)
* rate - time in milliseconds between trasparency changes (best under 100)
* delta - amount of change each time (ie 5, for 5% change in transparency)
*/
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
if (object != "[object]"){ //do this so I can take a string too
setTimeout("nereidFade("+object+","+destOp+","+rat e+","+delta+")",0);
return;
}
clearTimeout(nereidFadeTimers[object.sourceIndex]) ;
diff = destOp-object.filters.alpha.opacity;
direction = 1;
if (object.filters.alpha.opacity > destOp){
direction = -1;
}
delta=Math.min(direction*diff,delta);
object.filters.alpha.opacity+=direction*delta;
if (object.filters.alpha.opacity != destOp){
nereidFadeObjects[object.sourceIndex]=object;
nereidFadeTimers[object.sourceIndex]=setTimeout("n ereidFade(nereidFadeObjects["+object.sourceIndex+" ],"+destOp+","+rate+","+delta+")",rate);
}
}
//-->
</script>[/code:1]
and then when you call the image, use the following as an example.
[code:1]<img src="images/jamblo.gif" alt="Jamblo.org" width="88" height="31" border="0" style="filter:alpha(opacity=75)" onMouseOver="nereidFade(this,100,35,5)" onMouseOut="nereidFade(this,60,75,5)"/>[/code:1]
that's actually a pretty fancy little effect. Hope that helps.
Threeboy
05-26-2003, 04:56 PM
using javascript attributes. word.
Liquor_Riss, for most website you can VIEW > SOURCE it.
Liquor_Riss
05-26-2003, 05:36 PM
you mean the fade in and fade out? Why don't you take a gander at the source buddy. It's in there, I saw it. you know, I'll even post if for ya.
[code:1]<script language="JavaScript" type="text/JavaScript">
<!--
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
/* object - image to be faded (actual object, not name);
* destop - destination transparency level (ie 80, for mostly solid)
* rate - time in milliseconds between trasparency changes (best under 100)
* delta - amount of change each time (ie 5, for 5% change in transparency)
*/
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
if (object != "[object]"){ //do this so I can take a string too
setTimeout("nereidFade("+object+","+destOp+","+rat e+","+delta+")",0);
return;
}
clearTimeout(nereidFadeTimers[object.sourceIndex]) ;
diff = destOp-object.filters.alpha.opacity;
direction = 1;
if (object.filters.alpha.opacity > destOp){
direction = -1;
}
delta=Math.min(direction*diff,delta);
object.filters.alpha.opacity+=direction*delta;
if (object.filters.alpha.opacity != destOp){
nereidFadeObjects[object.sourceIndex]=object;
nereidFadeTimers[object.sourceIndex]=setTimeout("n ereidFade(nereidFadeObjects["+object.sourceIndex+" ],"+destOp+","+rate+","+delta+")",rate);
}
}
//-->
</script>[/code:1]
and then when you call the image, use the following as an example.
[code:1]<img src="images/jamblo.gif" alt="Jamblo.org" width="88" height="31" border="0" style="filter:alpha(opacity=75)" onMouseOver="nereidFade(this,100,35,5)" onMouseOut="nereidFade(this,60,75,5)"/>[/code:1]
that's actually a pretty fancy little effect. Hope that helps.
Thanks for the help and source posting :)
Jamblo
06-04-2003, 12:37 AM
ooh my site
haha coolness 8)
alycium
09-15-2003, 01:00 AM
I love this script..but how do I get the image to link? im new with coding and all =/ Plz help me out if you can...So it will be a fade-in fade-out linked image :)
[code:1]<a href="yourlink.htm">
<!-- Link code is up there^ -->
<img src="images/jamblo.gif" alt="Jamblo.org" width="88" height="31" border="0" style="filter:alpha(opacity=75)" onMouseOver="nereidFade(this,100,35,5)" onMouseOut="nereidFade(this,60,75,5)"/>
<!-- End linking code over < that way but also \/ way -->
</a>[/code:1]
alycium
09-15-2003, 04:00 AM
You are a GOD! ;)
Liquor_Riss
09-15-2003, 09:08 AM
You've got picture links on your site and you didn't know the code?...
alycium
09-15-2003, 12:59 PM
Now I had the pictures on my site..But it wasnt linked to a site and all..It just did the fade-in and out...
SileNceR
09-17-2003, 07:21 AM
can you add an onClick attribute to an image?
probably not compatible with most browsers if u can but interesting to know nonetheless...
Jamblo
11-02-2003, 10:11 AM
Yes you can, Silencer.
SileNceR
11-10-2003, 05:06 AM
ok :)
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.