图片
CSS
JS广告
便捷
下载
解答
截图
高清壁纸
后台模板
PS插件
网页特效
Css新闻
推荐代码
页面应用
技术文章
图片展示
广告条
广告代码
软件类
在线工具
常用信息
动画制作
图片处理
辅助小工具
转换软件
其他
软件问题
系统问题
网页问题
常识整理
互联网价值
网站
图标
APP
按钮
公告
2013网站频道新版上线,功能持续完善中……
02.17
更新
mac系统PS数位板没有压感解决方案
01.27
查看windows10系统是否激活
08.31
windows10激活失败,亲测最有效的解决方法
08.31
Mac OS 您需要安装旧 Java SE 6 运行环境才能打开
04.10
Adobe adobeau2017英文转换为中文[汉化方法]
04.01
Mac电脑系统翻墙方法
05.26
最全手机APP中的尺寸规范
05.12
中文WebFont解决方案Font-Spider
09.02
互联网
JS控件
按钮
黑色
灰色
白色
蓝色
绿色
黄色
橙色
>
代码
>
网页js特效
动画版的回到顶部和底部效果代码
上一篇
下一篇
0
作者:vip_260 来源: 日期:2014/3/10 14:24:58 人气:
标签:
[Code]<br /><br /><br /><br /><title>动画版的回到顶部和底部效果代码</title><br /><br /><**** type="text/css">#roll_top,#fall,#ct{position:relative;cursor:pointer...</****>
<!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> <title>动画版的回到顶部和底部效果代码</title> <meta http-equiv="content-type" content="text/html;charset=gb2312"> <style type="text/css"> body{padding:0px;margin:0px;} #roll_top,#fall,#ct{position:relative;cursor:pointer;height:40px;width:15px;} #roll_top{background:url(http://www.codefans.net/jscss/demoimg/201101/roll.png) no-repeat;} #fall{background:url(http://www.codefans.net/jscss/demoimg/201101/roll.png) no-repeat 0 -80px;} #ct{background:url(http://www.codefans.net/jscss/demoimg/201101/roll.png) no-repeat 0 -40px;} #roll{display:block;width:15px;margin-right:-508px;position:fixed;right:50%;top:50%;_margin-right:-507px;_position:absolute;_margin-top:300px;_top:expression(eval(document.documentElement.scrollTop));} </style> <!--[if IE]> <style type="text/css"> /* 修正IE6振动bug */ html,body{background-image:url(about:blank);background-attachment:fixed;} </style> <![endif]--> <script type="text/javascript" src="http://www.codefans.net/ajaxjs/jquery1.3.2.js"></script> <script type="text/javascript"> jQuery(document).ready(function($){ $('#roll_top').click(function(){$('html,body').animate({scrollTop: '0px'}, 800);}); $('#ct').click(function(){$('html,body').animate({scrollTop:$('.ct').offset().top}, 800);}); $('#fall').click(function(){$('html,body').animate({scrollTop:$('.footer,.footer_a').offset().top}, 800);}); }); </script> </head> <body> 预览效果时左下角会提示错误,而且看不到效果,刷新一下就可以看到效果了<br> <div class="head">这里是页面顶部</div> <div id="roll"> <div title="回到顶部" id="roll_top"></div> <div title="转到底部" id="fall"></div> </div> <div id="content" style="height:2000px;"></div> <div class="footer">这里是页面底部</div> </body> </html>
提示:复制和保存代码功能在FF下无效。
加关注
关于我们
帮助中心
意见反馈
设计导航
Copyright 2008
网站频道
All Rights Resverved.
提供:网页特效 JS广告 网站截图 酷站推荐 交流群:3506863
页面执行时间0.1406秒 查询数据库8次