我正在尝试制作一个悬停时“取消模糊”(删除文本阴影)的页面。
这适用于除 IE 之外的所有浏览器:http: //mmhudson.com/brett.html
它不起作用,因为当元素未悬停时我将颜色设置为“透明”,并且 IE 过滤器“模糊”继承了它,因此文本阴影也是透明的。
我怎样才能使过滤器不继承它或使它只有阴影不可见?
我目前正在使用插件,但如果更可取,我可以使用常规 css。
如果 IE 阻塞,请注意 html
我只需要支持 IE8 和 IE9,但 IE7 和更早版本也不错。
我正在尝试制作一个悬停时“取消模糊”(删除文本阴影)的页面。
这适用于除 IE 之外的所有浏览器:http: //mmhudson.com/brett.html
它不起作用,因为当元素未悬停时我将颜色设置为“透明”,并且 IE 过滤器“模糊”继承了它,因此文本阴影也是透明的。
我怎样才能使过滤器不继承它或使它只有阴影不可见?
我目前正在使用插件,但如果更可取,我可以使用常规 css。
如果 IE 阻塞,请注意 html
我只需要支持 IE8 和 IE9,但 IE7 和更早版本也不错。
问题不在于它继承了透明色,而在于 IE 根本不支持 text-shadow。
使用这个 stackoverflow.com/questions/6905658/css3-text-shadow-in-ie9
p.shadow {
filter: progid:DXImageTransform.Microsoft.Shadow(color=#0000FF,direction=45);
}
- - - - - -编辑 - - - - - - -
这是你要找的吗? http://jsfiddle.net/PaDwt/4/
-CSS
#paragraphs p{
/*the width needs to be a set value, not a percentage*/
width: 600px;
/*blur all paragraphs*/
color: transparent;
text-shadow: 0px 0px 2px #666666;
filter: progid:DXImageTransform.Microsoft.Blur(pixelradius=3);
}
-JS
$(document).ready(function(){
if($.browser.msie) $("#paragraphs p").css("color", "black");
$("#paragraphs p").mouseover(function(){
var thisP = this;
if($.browser.msie)
{
$("#paragraphs p").css({
filter:"progid:DXImageTransform.Microsoft.Blur(pixelradius=3)"
});
}
else{
$("#paragraphs p").css({
color:"transparent",
textShadow:"0 0 2px #666",
});
}
$(thisP).css({
color:"#000",
textShadow:"none",
filter:"none"
})
});
$("#paragraphs p").mouseout(function(){
if($.browser.msie)
{
$("#paragraphs p").css({
filter:"progid:DXImageTransform.Microsoft.Blur(pixelradius=3)"
});
}
else
{
$("#paragraphs p").css({
color:"transparent",
textShadow:"0 0 2px #666"
});
}
});
});
这适用于我在 IE9 中。