Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter Mouseovers possible???

Status
Not open for further replies.

A1Defiant

Technical User
May 24, 2001
22
0
0
GB
I'm wanting to create a mouseover so to create a style filter glow?
I can create a standard glow filter on text but the problem may stem around either the DOM on the script pointing at the wrong object or the fact that all sites are saying that to have a glow object for a DIV element you need to adjust the style properties to have a standard width and height!

Relevant Code:
<script>
function glowtext(){
this.filter=&quot;glow(color=white,strength=10)&quot;;
}
</script>
Inscript format
<DIV ID=&quot;bunglow&quot; class=index1 STYLE=&quot;position:absolute; width:200px; height:50px; top:150; left:150;
background:blue ;filter:glow(color=blue,strength=5)&quot; onmouseover=&quot;glowtext()&quot;> GLOWING TEXT

<table id=bunglow STYLE=&quot;filter:glowcolor=red,Strength=5) onclick=&quot;glowtext()&quot;>
GLOW TEXT
</TABLE>

</DIV>
 
To use those filters in javascript the code will need to be something like:
divname.filters.glow.color = 'color'
divname.filters.glow.strength = 'value'

It would be easiest if you would do this on a link. Then you could just define the hover action for it and you wouldn't have to use any javascript...
 
I've successfully managed to sort this out with the help of the web. This code works as a mouseover;

<Script language=javascript>
function togGlow(r) {
Glowing[r].filters.glow.enabled = !Glowing[r].filters.glow.enabled
}
</script>
<DIV style=&quot;position:absolute;Left:0px;Top:37px&quot;>
<TABLE>
<TR>
<TD>
<A href=&quot;nowhere&quot; onmouseover=&quot;togGlow(0)&quot; onmouseout=&quot;togGlow(0)&quot; id=&quot;Glowing&quot;>Home</A>
</TD>
</TR>
</TABLE>
</DIV>
 
Enabling the filter (like you did) will work fine too, but if you want to change the color or strength on mouseover you'll probably have to find a different way...

Here's a css example using hover; just in case you're curious.

<html>
<head>
<title>Glowing Text</title>
<style type=&quot;text/css&quot;>
a.glow {
cursor: text;
display: block;
filter: glow(color=red, strength=5);
height: 100%;
text-decoration: none;
width: 100%;
}

a.glow:hover {
filter: glow(color=blue, strength=5);
}
</style>
</head>
<body>
<a href=&quot;#&quot;>Regular Hyperlink</a>
<br /><br />
<a class=&quot;glow&quot; href=&quot;#&quot;>Glowing Hyperlink</a>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top