HTML5-页面多页面滑动
来源:互联网 发布:长沙unity3d培训 编辑:程序博客网 时间:2024/06/04 09:55
写这段代码为了记录学习HTML5过程的一些东西,结合一些可以抽起来以后再用.
HTML
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> <title>HelloWorld</title> <meta charset="utf-8" /> <link href="../Style/HTML1.css" rel="stylesheet" /> <script src="../Scripts/jquery-1.7.1.js"></script> <script> $(function () { $("nav a").bind("click", function (e) { $("html,body").animate({ "scrollTop": $($(this).attr("href")).position().top + 'px' }, 1000); e.cancelBubble = true; }); $("#tb-side").bind("click", function(e) { $("html,body").animate({ "scrollTop": '0px' }, 1000); e.cancelBubble = true; }) }) </script></head><body> <header> <h1>Header</h1> <h2>SubTitle</h2> <h4>HTML5 ROCKS</h4> </header> <div id="container"> <nav> <h3>NAV</h3> <a href="#article1" >LINK1</a> <a href="#article2" >LINK2</a> <a href="#article3" >LINK3</a> <a href="#article4" >LINK4</a> <a href="#article5" >LINK5</a> <a href="#article6">LINK6</a> <a href="#article7" >LINK7</a> </nav> <section> <article id="article1"> <header>Article Header</header> <p> article1 </p> <footer> <h2>Article Footer</h2> </footer> </article> <article id="article2"> <header>Article Header</header> <p> article2 </p> <footer> <h2>Article Footer</h2> </footer> </article> <article id="article3"> <header>Article Header</header> <p> articl3 </p> <footer> <h2>Article Footer</h2> </footer> </article> <article id="article4"> <header>Article Header</header> <p> articl4 </p> <footer> <h2>Article Footer</h2> </footer> </article> <article id="article5"> <header>Article Header</header> <p> articl5 </p> <footer> <h2>Article Footer</h2> </footer> </article> <article id="article6"> <header>Article Header</header> <p> articl6 </p> <footer> <h2>Article Footer</h2> </footer> </article> <article id="article7"> <header>Article Header</header> <p> articl7 </p> <footer> <h2>Article Footer</h2> </footer> </article> </section> <aside> <h3>Aside</h3> <p> HTML5: "Lorem ipsum dolor nunc aut nunquam sit amet, consectetur adipiscing elit. Vivamus at est eros, vel fringilla urna. Pellentesque odio rhoncus </p> </aside> <footer> <h2>Footer</h2> </footer> </div> <div id="tb-side"> <ul> <li> <a>Top</a> </li> </ul> </div></body></html>
CSS
body { background-color: #CCCCCC; font-family: geneva, arial, helvetica, sans-serif; margin: 0px auto; max-width: 900px; border: solid; border-color: #FFFFFF;}header { background-color: #F47D31; display: block; color: #ffffff; text-align: center;}header h2 { margin: 0px;}h1 { font-size: 72px; margin: 0px;}h2 { font-size: 24px; margin: 0px; text-align: center; color: #F47D31;}h3 { font-size: 18px; margin: 0px; text-align: center; color: #f47d31;}article { height: 300px;}#tb-side { position: fixed; right: .5%; bottom: 50px; z-index: 10000; } #tb-side li { position: relative; padding: 4px 0; width: 30px; height: 30px; list-style: none; background: #f47d31; color: white; cursor: pointer; }
- HTML5-页面多页面滑动
- html5 页面滑动
- iOS 多页面滑动
- 滑动页面
- 页面滑动
- viewpageIndicator多页面滑动切换
- android多页面滑动切换
- Android 多页面左右滑动
- ViewPager多页面滑动效果
- viewpageIndicator多页面滑动切换
- ViewPager多页面滑动效果
- ViewPager实现多页面滑动
- HTML5手机页面触屏滑动上下翻页特效
- html5 touch事件实现触屏页面上下滑动(一)
- html5 touch事件实现页面上下滑动 - Leinov
- html5页面在ios滑动卡顿问题
- IOS页面加载Html5页面
- android多个页面滑动视图实现
- 如何避免自己发出的邮件被误判为垃圾邮件
- C++ 用socket封装成http
- 一篇鞭策程序员的短文:我们这一代的汽车工人
- 多路IO复用模型 select epoll
- fusionchars报表插件的使用
- HTML5-页面多页面滑动
- spring mvc @Qualifier注解接口来注入 @Service
- 类集框架的简单示例
- Android Maps app开源,邀请开发者共同参与
- 今天开始学习《30天自制操作系统》
- c语言实现字符串字串的替换
- 关闭oralce的进程oracle.exe,怎么再重新打开进程oracle.exe
- 手把手让你实现开源企业级web高并发解决方案(lvs+heartbeat+varnish+nginx+eAccelerator+memcached)
- Linux安装mysql——源码安装