层展开/关闭 运动缓冲效果
来源:互联网 发布:腹黑兔子无耻外交 知乎 编辑:程序博客网 时间:2024/04/27 16:44
<script type="text/javascript"><!--google_ad_client = "pub-4490194096475053";/* 内容页,300x250,第一屏 */google_ad_slot = "3685991503";google_ad_width = 300;google_ad_height = 250;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
http://www.corange.cn/archives/2008/10/1930.html
- <!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" xml:lang="zh-CN" lang="zh-CN">
- <head>
- <title>层展开/关闭 - 运动缓冲效果</title>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <script type="text/javascript">
- /*
- 函数名称: Scroll
- Scroll(obj, h, s)
- 参数说明:
- obj,[object] id值或对象. 必需
- h,[height] 展开后的高度. 可选(默认为200px)
- s,[speed] 展开速度,值越小展开速度越慢. 可选(默认为1.2){建议取值为1.1到2.0之间[例如:1.17]}.
- 函数返回值:
- true 展开(对象的高度等于展开后的高度)
- false 关闭(对象的高度等于原始高度)
- */
- function Scroll(obj, h, s){
- if(obj == undefined){return false;}
- var hh = h || 200;
- var ss = s || 1.2;
- var obj = typeof(obj)=="string"?document.getElementById(obj):obj;
- var status = obj.getAttribute("status")==null;
- var oh = parseInt(obj.offsetHeight);
- obj.style.height = oh;
- obj.style.display = "block";
- obj.style.overflow = "hidden";
- if(obj.getAttribute("oldHeight") == null){
- obj.setAttribute("oldHeight", oh);
- }else{
- var oldH = Math.ceil(obj.getAttribute("oldHeight"));
- }
- var reSet = function(){
- if(status){
- if(oh < h){
- oh = Math.ceil(h-(h-oh)/s);
- obj.style.height = oh+"px";
- }else{
- obj.setAttribute("status",false);
- window.clearInterval(IntervalId);
- }
- }else{
- obj.style.height = oldH+"px";
- obj.removeAttribute("status");
- window.clearInterval(IntervalId);
- }
- }
- var IntervalId = window.setInterval(reSet,10);
- return status;
- }
- window.onload= function(){
- document.getElementById('detail').onclick = function(){
- Scroll('detail', 300, 1.3);
- }
- document.getElementById('text').onclick = function(){
- Scroll('text');
- }
- }
- </script>
- </head>
- <body>
- <p id="detail" style="border:1px dashed #f00;">这是一个段落啦!!哇哈哈哈<br/>点我一下下啦:)</p>
- <div id="text" style="border:1px solid #0f0">Hello World!<br/>点击展开www.corange.cn</div>
- <button onclick="Scroll('text', 400, 1.2)">Hello World</button>
- </body>
- </html>
- 层展开/关闭 运动缓冲效果
- 层展开\关闭-运动缓冲效果
- 展开层与关闭层的动态缓冲效果特效
- flash效果展开层、关闭层,并且可以拖动层。
- 层的缓冲运动
- js 缓冲运动效果
- html中鼠标点击展开关闭层效果
- JS带缓冲效果打开、关闭、移动一个层
- 点击展开关闭效果
- 层的展开收缩效果
- 在代码层关闭或展开 CollapsiblePanelExtender
- 单击控制层的展开和关闭
- js带缓冲与关闭弹出层
- 缓冲运动
- 缓冲运动
- JQuery展开关闭内容块效果
- 最简单的点击展开关闭效果
- 缓冲运动 //缓冲运动 (目标值
- 解决Ubuntu8.10下Firefox经常显示连接被重置的问题
- J2SE基础一
- 什么是通货紧缩和通货膨胀?其主要特征是什么〔转〕
- 高性能网站建设之减少Http连接数
- 好的测试工程师应具备的素质
- 层展开/关闭 运动缓冲效果
- JQuery复合属性选择器小例
- System.Net.Mail.MailMessage 进行email发送
- 通用分页存储过程
- PHP的拼写检查函数库
- JS显示或隐藏层的函数
- javascript 实现随机数
- Ubuntu 8.10环境NVIDIA显卡无法正常工作解决方法
- 关于PHP编码转化的问题