侧边栏滑动效果
来源:互联网 发布:java json解析map对象 编辑:程序博客网 时间:2024/04/30 00:51
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>侧边栏滑动效果</title> <style> *{ padding:0; margin:0; } #oLeft{ width:200px; height:550px; background-color: #ccc; left: -200px; position:relative; } #oLeft div p{ text-align: center; font-size:20px; } #ibtn{ position: absolute; width:30px; height:60px; background-color: #a00; color:#fff; line-height: 30px; top: 245px; left:200px; border-radius:0 5px 5px 0; text-align: center; cursor: pointer; } </style> <script type="text/javascript"> window.onload = function(){ var oLeft = document.getElementById('oLeft'); oLeft.onmouseover = function(){ startMove(0); } oLeft.onmouseout = function(){ startMove(-200); } } var timer = null; function startMove(iTarget){ clearInterval(timer); //先清除定时器,防止鼠标滑过重复触发 var oLeft = document.getElementById('oLeft'); timer = setInterval(function(){ var speed = 0; if(oLeft.offsetLeft>iTarget){ speed = -10; }else{ speed = 10; } if(oLeft.offsetLeft == iTarget){ clearInterval(timer); }else{ oLeft.style.left = oLeft.offsetLeft + speed +'px'; } },30) } </script></head><body><div id="oLeft"> <div> <p>侧边栏</p> <p>侧边栏</p> <p>侧边栏</p> </div> <div id="ibtn"> <p>分享</p> </div></div></body></html>
0 0
- 侧边栏滑动效果
- Android 双向左右滑动侧边栏效果
- 仿人人网侧边栏滑动效果
- Android 仿通讯录侧边栏滑动 SiderBar效果
- Android 仿通讯录侧边栏滑动 SiderBar效果
- 用Ionic实现侧边栏菜单 滑动效果
- android:滑动侧边栏
- Android滑动侧边栏
- 滑动侧边栏
- jquery侧边栏效果
- ios侧边栏效果
- 笔记-侧边栏效果
- 抽屉效果侧边栏
- android 滑动侧边栏 SlideMenu
- 上下滑动的侧边栏
- android用最简单的方法实现QQ5.0的侧边栏滑动效果
- Android开发之使用ViewDragHelper实现侧边栏滑动的效果
- js实现侧边栏效果
- spring可以代替EJB吗
- OpenCV中Mat属性step,size,step1,elemSize,elemSize1
- android sqlite 数据库存贮类型 long double floate 等 数据类型
- 笔试题目笔记
- Android手机UI设计---”知乎“界面外观模仿篇(二)---在Fragment里使用自定义listview以及popupwindow弹出窗口
- 侧边栏滑动效果
- algorithm的sort排序函数
- layers-http/s
- hdu1029 Ignatius and the Princess IV
- Integer类型与int类型的==比较
- Django后台修改 admin.py
- Android退出程序三种比较优雅的方式
- hadoop大量小文件的优化策略
- Java学习路线