|
| I found the following script, which will swap two images for one another on
mouseover, but do so gradually.
This only works on IE (not Firefox or Mac). I was told that this can now be
made to work on all major browsers. Could someone point me to a script that
can show me how?
/*******************************************************************
*
* Function : transIn /transOut
*
* Description : Detects browser that can do opacity and fades the images
* For browsers that do not support opacity it just does an image swap.
* (I only know about NS4 but maybe IE on a Mac also ?)
* For these functions to work you need to name the image
* e.g. for an image named "home" you need
* <IMG .... NAME="home">
* and you need 2 images, the on and the off image
*****************************************************************/
JSFX.transIn = function(imgName, rollName)
{
if(rollName == null)
rollName=imgName;
/*** Stop emails because the rollover was named incorrectly ***/
if(!JSFX.RolloverObjects[rollName])
{
JSFX.Rollover.error(rollName);
return;
}
var img = JSFX.findImg(imgName, document);
if(JSFX.hasFilters(img))
JSFX.imgTransIn(img, JSFX.RolloverObjects[rollName].img_src);
else
{
if(img.offSrc==null)
img.offSrc=img.src;
img.src=JSFX.RolloverObjects[rollName].img_src;
}
}
JSFX.transOut = function(imgName)
{
var img = JSFX.findImg(imgName, document);
if(JSFX.hasFilters(img))
JSFX.imgTransOut(img);
else
img.src=img.offSrc;
}
|
|