View Full Version : mouse over glow
Mystech
09-08-2008, 04:21 AM
Basically, I need my pics to light up when the mouse rolls over it to show that it's clickable. Question is, should i go hunt for a javascript to do it or would the mouse over command in css be a better choice?
jscheuer1
09-08-2008, 11:41 AM
It depends. If you want a smooth gradual effect, javascript would be better. If you just want an image change immediately from - say 70% opacity to full opacity, css would be fine. But the opacity style property isn't standard across browsers, so several properties would need to be defined for full cross browser support. And the hover pseudo class is only supported for anchor links in earlier (6 and 5.5) versions of IE, so you would need to do it on the image(s) as children of the link, ex*:
a img {
opacity:0.7;
filter:alpha(opacity=70);
border:none;
}
a:hover img {
opacity:0.9999;
filter:alpha(opacity=100);
}
<a href="whatever.htm"><img src="some.gif" alt=""></a>
* Only opacity and filter:alpha(opacity) are shown in this example, as they cover virtually all modern browsers that support opacity style. The only other two types are:
-moz-opacity:0.7;
-khtml-opacity:0.7;
Which are for older Mozilla (NS before v6 or so, some others perhaps) based and older Safari (less than 2 or 2 point something - not sure when it changed to generic opacity, it's at 3+ now) browsers respectively.
Mystech
09-09-2008, 04:53 AM
drat, it seems the more i learn, the more i need to learn... can't these dratted companies agree to one... Thanks a bunch. :)
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.