Div+Js实现的带阴影菜单 微软以前网站曾用过
作者:bea
<title>Div+Js实现的带阴影菜单 微软以前网站曾用过</title> <script> var global = window.document global.fo_shadows = new Array function makeRectangularDropShadow(el, color, size) { var i; for (i=size; i>0; i--) { var
<title>Div+Js实现的带阴影菜单 微软以前网站曾用过</title>
<script>
var global = window.document
global.fo_shadows = new Array
function makeRectangularDropShadow(el, color, size)
{
var i;
for (i=size; i>0; i--)
{
var rect = document.createElement('div');
var rs = rect.style
rs.position = 'absolute';
rs.left = (el.style.posLeft + i) + 'px';
rs.top = (el.style.posTop + i) + 'px';
rs.width = el.offsetWidth + 'px';
rs.height = el.offsetHeight + 'px';
rs.zIndex = el.style.zIndex - i;
rs.backgroundColor = color;
var opacity = 1 - i / (i + 1);
rs.filter = 'alpha(opacity=' + (100 * opacity) + ')';
el.insertAdjacentElement('afterEnd', rect);
global.fo_shadows[global.fo_shadows.length] = rect;
}
}
</script>
<style>body,td,div,a,input{font:menu;line-height:180%}</style>
<div id=menu style="position:absolute; left: 10px; top: 10px; background: #EEEEEE; width: 120px; height: 100px; padding: 3px; border: 1 #999999 solid; cursor: default">
<div style="border: 1 solid #EEE"
onmouseover="this.style.background='#CCC'; this.style.borderColor='#999'"
onmouseout ="this.style.background='#EEE'; this.style.borderColor='#EEE'"
>Jb51.net</div>
<div style="border: 1 solid #EEE"
onmouseover="this.style.background='#CCC'; this.style.borderColor='#999'"
onmouseout ="this.style.background='#EEE'; this.style.borderColor='#EEE'"
></div>
<div style="border: 1 solid #EEE"
onmouseover="this.style.background='#CCC'; this.style.borderColor='#999'"
onmouseout ="this.style.background='#EEE'; this.style.borderColor='#EEE'"
>网页特效</div>
<script>
makeRectangularDropShadow(document.all["menu"], "#666666", 4);
</script>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行]
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- javascript 事件加载与预加载
- Javascript 键盘keyCode键码值表
- JQuery与iframe交互实现代码
- jquery 弹出登录窗口实现代码
- 使用jQuery获取radio/checkbox组的值的代码收集
- Jquery 高亮显示文本中重要的关键字
- JQuery 写的个性导航菜单
- JavaScript中出现乱码的处理心得
- js 页面刷新location.reload和location.replace的区别小结
- CSS+Jquery实现页面圆角框方法大全
- HTA版JSMin(省略修饰语若干)基于javascript语言编写
- javascript下arguments,caller,callee,call,apply示例及理解
- 关于Aptana Studio生成自动备份文件的解决办法
- window.js 主要包含了页面的一些操作
- js 效率组装字符串 StringBuffer
- JS+CSS实现的一种交互体验 表单页面
- javascript 仿开心网好友印象功能(点击文字弹出印象框)
- JavaScript 未知高度元素垂直居中实现代码
- 纯CSS实现的当鼠标移上图片添加阴影效果代码