PDA

View Full Version : Layer filter called by Javascript



ranger
01-13-2005, 11:33 PM
Hi there,

I have a hidden layer (a gif image), as follows:
<div id="1" style="position:absolute; left:2px; top:2px; visibility:hidden;"><img src="./image.gif"></div>

The image becomes visible by passing the mouse cursor over a text, by calling a javascript function:
....." OnMouseOut="hide_layer('1');" OnMouseOver="showFilter('1');">

The show_layer / hide_layer function are:

<script language="JavaScript">
<!--
function show_layer(lname)
{
if(document.layers)
document.layers[lname].visibility = 'show'
if(document.all)
document.all(lname).style.visibility = 'visible'
}

function hide_layer(lname)
{
if (document.layers)
document.layers[lname].visibility = 'hide'
if(document.all)
document.all(lname).style.visibility = 'hidden'
}
// -->
</script>

It works fine, but I want my image to come up gradually, by using the filter:
revealTrans(Duration=1,Transition=2)

If anybody knows how the "show_layer" function can be modified so that the filter works, please teach me.

Thanks a lot.
Ranger

simonf
01-14-2005, 07:29 AM
Hi

Take a look at http://www.dynamicdrive.com/dynamicindex4/highlightgrad.htm as it's what your looking for by the sound of it.