If you still want to use the effect and disable it for older versions you could try adding a little bit of code to the htc file to sniff the browser version. This isn't 100% reliable because some browsers allow you to change how they report themselves, but it should work in this case I think since any non-IE browsers are going to ignore the htc file anyway. I don't have anyway to test the modifications because I don't have access to anything older than IE 6 right now, but perhaps ANTO/TW can give it a try when he has a chance. It should disable the effect in anything older than IE6 as it is set now and you can change it to IE 5.5 and up by changing the
if to
if(is_ie5_5up). This would be the new code for the .htc file:
<public:component>
<public:attach event="onmouseover" onevent="domouseover()">
<public:attach event="onmouseout" onevent="domouseout()">
<script language="javascript">
var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3 = (is_ie && (is_major < 4));
var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
var is_ie4up = (is_ie && (is_major >= 4));
var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5_5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
var is_ie5up = (is_ie && !is_ie3 && !is_ie4);
var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
var is_ie6 = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
var is_ie6up = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);
function domouseover()
{
if(is_ie6up)
{
with(element)
{
filters.item(0).Apply();
filters.item(0).Play();
}
}
}
function domouseout()
{
domouseover();
}
</script>
</public:component>
- <public:component>
- <public:attach event="onmouseover" onevent="domouseover()">
- <public:attach event="onmouseout" onevent="domouseout()">
- <script language="javascript">
- var agt=navigator.userAgent.toLowerCase();
- var is_major = parseInt(navigator.appVersion);
- var is_minor = parseFloat(navigator.appVersion);
- var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
- var is_ie3 = (is_ie && (is_major < 4));
- var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
- var is_ie4up = (is_ie && (is_major >= 4));
- var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
- var is_ie5_5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
- var is_ie5up = (is_ie && !is_ie3 && !is_ie4);
- var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
- var is_ie6 = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
- var is_ie6up = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);
- function domouseover()
- {
- if(is_ie6up)
- {
- with(element)
- {
- filters.item(0).Apply();
- filters.item(0).Play();
- }
- }
- }
- function domouseout()
- {
- domouseover();
- }
- </script>
- </public:component>
The browser-sniffing code came from here:
http://www.mozilla.org/docs/web-develop ... _type.html//edit
after reading your last post I think you would still have to use a separate class for the effect and apply it only to the textEffect to get around the height problem.
Try this for the content of your style sheet:
a.textEffect{cursor:crosshair;height:1px;behavior:url(effect.htc);filter:progid:dximagetransform.microsoft.gradientwipe(duration=1)}
a:link{COLOR:#8173D5; TEXT-DECORATION: none; font-weight: bold}
a:visited{COLOR:#8173D5; TEXT-DECORATION: none; font-weight: bold}
a:active{COLOR:#8173D5; TEXT-DECORATION: none; font-weight: bold}
a:hover{COLOR:#CCCCFF; TEXT-DECORATION: none; cursor: crosshair}
- a.textEffect{cursor:crosshair;height:1px;behavior:url(effect.htc);filter:progid:dximagetransform.microsoft.gradientwipe(duration=1)}
- a:link{COLOR:#8173D5; TEXT-DECORATION: none; font-weight: bold}
- a:visited{COLOR:#8173D5; TEXT-DECORATION: none; font-weight: bold}
- a:active{COLOR:#8173D5; TEXT-DECORATION: none; font-weight: bold}
- a:hover{COLOR:#CCCCFF; TEXT-DECORATION: none; cursor: crosshair}
and this for the main html file:
<html>
<head>
<title>test page</title>
<link rel="stylesheet" href="ozzu.css" type="text/css">
</head>
<body bgcolor=#000000>
<p align="center"><a class="textEffect" href="http://www.ozzu.com">Text Link Example</a></p>
<p align="center">
<a href="http://www.ozzu.com"><img src="donald.gif" border="0"></a>
</p>
</body>
</html>
- <html>
- <head>
- <title>test page</title>
- <link rel="stylesheet" href="ozzu.css" type="text/css">
- </head>
- <body bgcolor=#000000>
-
-
- <p align="center"><a class="textEffect" href="http://www.ozzu.com">Text Link Example</a></p>
-
-
- <p align="center">
- <a href="http://www.ozzu.com"><img src="donald.gif" border="0"></a>
- </p>
- </body>
- </html>
On an unrelated note, I don't think you want to have any <!-- comments in your external style sheet - those are only used in embedded style sheets that appear in the head portion of the html page itself.
Hopefuly, the browser-sniffing code will kill the javascript errors in older versions of IE and the separate css class will solve the height issue.
To save time I put the files on one of my websites where you can try them out to see if they cause the errors on IE 5:
test files
Free Programming Resources