资料
表格
制度
合同
管理
职场
经营
创业
范文
总结
计划
作文
文章
美文
词句
教程
模板
图片
字体
图标
办公
人事
财务
生产
管理资源吧首页
>>>
教程
>>>
编程
>>>
JavaScript教程
>>>
jQuery 淡入淡出、展开收缩菜单实现代码
效果图:
运行以后,刷新下即可。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>jQuery淡入淡出、展开收缩菜单</title> <style type="text/css"> ul li{list-style:none;} ul li.menu{position:relative;width:120px;} ul li.menu ul{display:none;text-align:center;background:#fff;border:1px solid #ddd;width:100px;padding:5px;} ul li.menu ul li{padding:5px 0;border-bottom:1px dotted #ddd;}</style> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3Cscript%20language%3D%22javascript%22%20src%3D%22http%3A%2F%2Fimg.glzy8.com%2Fjslib%2Fjquery%2Fjquery-1.3.2.min.js%22%3E%3C%2Fscript%3E"> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3Cscript%20language%3D%22javascript%22%20type%3D%22text%2Fjavascript%22%3E%20%0D%0A%24(document).ready(function()%7B%20%0D%0A%24(%22.menu%22).hover(%20%0D%0Afunction()%7B%20%0D%0A%2F%2F%24(%22.content%22).fadeIn(800)%3B%20%2F%2F%20%E6%B7%A1%E5%85%A5%20%0D%0A%24(%22.content%22).slideDown(800)%3B%20%2F%2F%20%E5%B1%95%E5%BC%80%20%0D%0A%7D%2Cfunction()%7B%20%0D%0A%2F%2F%24(%22.content%22).fadeOut(1000)%20%2F%2F%20%E6%B7%A1%E5%87%BA%20%0D%0A%24(%22.content%22).slideUp(1000)%E3%80%80%E3%80%80%E3%80%80%20%2F%2F%20%E6%94%B6%E7%BC%A9%20%0D%0A%7D)%3B%20%0D%0A%7D)%20%0D%0A%3C%2Fscript%3E"> </head> <body> <ul> <li class="menu"> <a>弹出菜单</a> <ul class="content"> <li><a href="#" _ewebeditor_ta_href="%23">菜单内容1</a></li> <li><a href="#" _ewebeditor_ta_href="%23">菜单内容2</a></li> <li><a href="#" _ewebeditor_ta_href="%23">菜单内容3</a></li> <li><a href="#" _ewebeditor_ta_href="%23">菜单内容4</a></li> <li><a href="#" _ewebeditor_ta_href="%23">菜单内容5</a></li> </ul> </li> </ul> </body> </html>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行
]
教程首页
更多教程