JS+Div实现的阴影菜单
2011-05-09 09:39
453 查看
代码简介:
JS+Div实现的阴影菜单,放出来的让大家学习JS,CSS的朋友参考。
代码内容:
代码来自:http://www.webdm.cn/webcode/39e04de5-02c5-4e32-9833-b5cd6e131906.html
JS+Div实现的阴影菜单,放出来的让大家学习JS,CSS的朋友参考。
代码内容:
<title>JS+Div实现的阴影菜单_网页代码站(www.webdm.cn)</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'" >webdm.cn</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> <br> <p><a href="http://www.webdm.cn">网页代码站</a> - 最专业的代码下载网站 - 致力为中国站长提供有质量的代码!</p>
代码来自:http://www.webdm.cn/webcode/39e04de5-02c5-4e32-9833-b5cd6e131906.html
相关文章推荐
- Div+Js实现的带阴影菜单 微软以前网站曾用过
- Div+Js实现的带阴影菜单 微软以前网站曾用过
- DIV+CSS+JS实现树形菜单
- DIV+JS实现可展开、折叠的菜单代码
- DIV+Js实现简单树形菜单
- div+css+js实现菜单的收缩与展开
- JS闭包实现给DIV添加事件 显示二级菜单例子
- Js实现点击按钮创建删除div
- JS实现-DIV自动居中代码
- 乐杨俊:div实现阴影效果(适应各个浏览器)
- DIV+CSS实现的横向二级菜单
- JS使用cookie实现DIV提示框只显示一次的方法
- 菜单条_div实现二级竖菜单
- node.js+Mysql实现无限菜单分类
- DIV+CSS+JS树形菜单,可以刷新不改变菜单
- js实现的点击div区域外隐藏div区域
- js实现Div拖拽
- js实现收缩菜单效果实例代码
- JS来实现省市县三级联动菜单