资料
表格
制度
合同
管理
职场
经营
创业
范文
总结
计划
作文
文章
美文
词句
教程
模板
图片
字体
图标
办公
人事
财务
生产
管理资源吧首页
>>>
教程
>>>
编程
>>>
JavaScript教程
>>>
yahoo首页伸缩效果代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>runcode</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="Author" content="Sheneyan" /> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3Cscript%20type%3D%22text%2Fjavascript%22%3E%20%0D%0Avar%20mh%20%3D%2030%3B%2F%2F%E6%9C%80%E5%B0%8F%E9%AB%98%E5%BA%A6%20%0D%0Avar%20step%20%3D%201%3B%2F%2F%E6%AF%8F%E6%AC%A1%E5%8F%98%E5%8C%96%E7%9A%84px%E9%87%8F%20%0D%0Avar%20ms%20%3D%2010%3B%2F%2F%E6%AF%8F%E9%9A%94%E5%A4%9A%E4%B9%85%E5%BE%AA%E7%8E%AF%E4%B8%80%E6%AC%A1%20%0D%0Afunction%20toggle(o)%7B%20%0D%0A%20%20if%20(!o.tid)o.tid%20%3D%20%22_%22%20%2B%20Math.random()%20*%20100%3B%20%0D%0A%20%20if%20(!window.toggler)window.toggler%20%3D%20%7B%7D%3B%20%0D%0A%20%20if%20(!window.toggler%5Bo.tid%5D)%7B%20%0D%0A%20%20%20%20window.toggler%5Bo.tid%5D%3D%7B%20%0D%0A%20%20%20%20%20%20obj%3Ao%2C%20%0D%0A%20%20%20%20%20%20maxHeight%3Ao.offsetHeight%2C%20%0D%0A%20%20%20%20%20%20minHeight%3Amh%2C%20%0D%0A%20%20%20%20%20%20timer%3Anull%2C%20%0D%0A%20%20%20%20%20%20action%3A1%20%0D%0A%20%20%20%20%7D%3B%20%0D%0A%20%20%7D%20%0D%0A%20%20o.style.height%20%3D%20o.offsetHeight%20%2B%20%22px%22%3B%20%0D%0A%20%20if%20(window.toggler%5Bo.tid%5D.timer)clearTimeout(window.toggler%5Bo.tid%5D.timer)%3B%20%0D%0A%20%20window.toggler%5Bo.tid%5D.action%20*%3D%20-1%3B%20%0D%0A%20%20window.toggler%5Bo.tid%5D.timer%20%3D%20setTimeout(%22anim('%22%2Bo.tid%2B%22')%22%2Cms%20)%3B%20%0D%0A%7D%20%0D%0Afunction%20anim(id)%7B%20%0D%0A%20%20var%20t%20%3D%20window.toggler%5Bid%5D%3B%20%0D%0A%20%20var%20o%20%3D%20window.toggler%5Bid%5D.obj%3B%20%0D%0A%20%20if%20(t.action%20%3C%200)%7B%20%0D%0A%20%20%20%20if%20(o.offsetHeight%20%3C%3D%20t.minHeight)%7B%20%0D%0A%20%20%20%20%20%20clearTimeout(t.timer)%3B%20%0D%0A%20%20%20%20%20%20return%3B%20%0D%0A%20%20%20%20%7D%20%0D%0A%20%20%7D%20%0D%0A%20%20else%7B%20%0D%0A%20%20%20%20if%20(o.offsetHeight%20%3E%3D%20t.maxHeight)%7B%20%0D%0A%20%20%20%20%20%20clearTimeout(t.timer)%3B%20%0D%0A%20%20%20%20%20%20return%3B%20%0D%0A%20%20%20%20%7D%20%0D%0A%20%20%7D%20%0D%0A%20%20o.style.height%20%3D%20(parseInt(o.style.height%2C%2010)%20%2B%20t.action%20*%20step)%20%2B%20%22px%22%3B%20%0D%0A%20%20window.toggler%5Bid%5D.timer%20%3D%20setTimeout(%22anim('%22%2Bid%2B%22')%22%2Cms%20)%3B%20%0D%0A%7D%20%0D%0A%3C%2Fscript%3E"> <style type="text/css"> div.xx{border:solid 1px;overflow:hidden;} div.xx h5{border:solid 1px;border-width:0 0 1px;padding:0;margin:0;height:30px;line-height:30px;cursor:pointer;background:#eee;} </style> </head> <body> <div class="xx"><h5 onclick="toggle(this.parentNode)">点击我看"伸缩效果"</h5> <p><a href="http://www.glzy8.com/" _ewebeditor_ta_href="http%3A%2F%2Fwww.glzy8.com%2F">管理资源吧</a></p> <br> <p><a href="http://www.xiaoshuo8.net/" _ewebeditor_ta_href="http%3A%2F%2Fwww.xiaoshuo8.net%2F">爱在小说吧</a></p><br> <p><a href="http://bbs.glzy8.com/" _ewebeditor_ta_href="http%3A%2F%2Fbbs.glzy8.com%2F">脚本交流社区</a></p> <br> </div> </body> </html>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行
]
教程首页
更多教程