求一个能满足IE 7 8div隐形效果的 求一个可以满足ie 7 8 中Div 阴影效果的实现方法 不要box-shadow 不要pie.js 谢谢 各位大侠 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <style> div{width:100px; height:100px;background:#d07575;} </style> <div id="box"></div> <script> function getCss(o,key){ return o.currentStyle[key] } function addShadow(_box){ if(document.all){//IE var getWidth,getHeight,createBox,nowHtml,defaultHTML; getWidth = getCss(_box,"width"); getHeight = getCss(_box,"height"); _box.style.cssText += ";position:absolute;z-index:1;top:0;left:0;"; nowHtml = _box.outerHTML; defaultHTML = '<div id="creatediv">' + nowHtml +'</div>'; _box.outerHTML = defaultHTML; var ss = document.getElementById("creatediv"); ss.style.cssText += ";position:relative;width:"+getWidth+";height:"+getHeight; createBox = document.createElement("em"); createBox.style.cssText = ";position:absolute; z-index:0;bottom:-10px; right:-10px; background:#000;display:block;width:100%;height:100%;filter:progid:DXImageTransform.Microsoft.Blur(pixelradius=5); "; ss.appendChild(createBox); }else{//chrome FF ... _box.style.cssText = "-webkit-box-shadow:5px 5px 5px #000;-moz-box-shadow:5px 5px 5px #000;box-shadow:5px 5px 5px #000;" } } var thisID = document.getElementById("box"); addShadow(thisID) </script>尝试了这种方法 基本你要的效果出来了 实用性不大 。 你看看吧 具体颜色值及模糊程度 可以在createBox.style.cssText里面的CSS那调整。没用参数 写死了。 参考下http://www.zhangxinxu.com/wordpress/2010/07/css%e5%ae%9e%e7%8e%b0%e8%b7%a8%e6%b5%8f%e8%a7%88%e5%99%a8%e7%9a%84box-shadow%e7%9b%92%e9%98%b4%e5%bd%b1%e6%95%88%e6%9e%9c2/ 关于js面向对象的继承问题 js函数中怎么获取request中值的属性 求source 使表格的单元格可编辑? 我写的代码为什么在ff显示好好的但是在IE就显示不出来呢? js如何从td中移除一个span? 如何将下面程序中的字符串用一个变量来代替,求大神指点! ★☆★☆★☆★☆★☆★☆setTimeout问题,郁闷至急!请赐教!求助! 请教如何解决以下问题 js正则高亮与替换求教 为什么我的菜单看不见文字,文字都跑到下面去了 node.js 如何访问sql server
<style>
div{width:100px; height:100px;background:#d07575;}
</style>
<div id="box"></div>
<script>
function getCss(o,key){
return o.currentStyle[key]
}
function addShadow(_box){
if(document.all){//IE
var getWidth,getHeight,createBox,nowHtml,defaultHTML;
getWidth = getCss(_box,"width");
getHeight = getCss(_box,"height");
_box.style.cssText += ";position:absolute;z-index:1;top:0;left:0;";
nowHtml = _box.outerHTML;
defaultHTML = '<div id="creatediv">' + nowHtml +'</div>';
_box.outerHTML = defaultHTML;
var ss = document.getElementById("creatediv");
ss.style.cssText += ";position:relative;width:"+getWidth+";height:"+getHeight;
createBox = document.createElement("em");
createBox.style.cssText = ";position:absolute; z-index:0;bottom:-10px; right:-10px; background:#000;display:block;width:100%;height:100%;filter:progid:DXImageTransform.Microsoft.Blur(pixelradius=5); ";
ss.appendChild(createBox);
}else{//chrome FF ...
_box.style.cssText = "-webkit-box-shadow:5px 5px 5px #000;-moz-box-shadow:5px 5px 5px #000;box-shadow:5px 5px 5px #000;"
}
}
var thisID = document.getElementById("box");
addShadow(thisID)
</script>尝试了这种方法 基本你要的效果出来了 实用性不大 。 你看看吧 具体颜色值及模糊程度 可以在createBox.style.cssText里面的CSS那调整。没用参数 写死了。