求一个可以满足ie 7 8 中Div 阴影效果的实现方法 不要box-shadow 不要pie.js 谢谢 各位大侠
解决方案 »
- js中参数未传的问题,以及两个数字or运算返回值问题
- 脚本求优化
- 求教一个js程序
- 没见过此写法 谁见过 指点一下 js
- 请问大家关于页面后退的问题
- 一个网页,上下两桢(分别调用两个不同的文件top.asp和content.asp),如何在content.asp里实现一点隐藏,上面的桢就会隐藏起来,一点打
- 有没有利用javascript脚本访问pc机串口的方法?
- 大家帮我看看关于JS中数组元素运算的问题
- 如何获得所选radio的文本
- 用javascript保存txt文本时显示异常,总会自动换行,怎么破?
- 为什么我的菜单看不见文字,文字都跑到下面去了
- 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那调整。没用参数 写死了。