Bootstrap Scrollspy Plugin
来源:互联网 发布:淘宝在哪里搜店铺? 编辑:程序博客网 时间:2024/04/30 03:06
导航栏Scrollspy例子
<!-- The scrollable area --><body data-spy="scroll" data-target=".navbar" data-offset="50"><!-- The navbar - The <a> elements are used to jump to a section in the scrollable area --><nav class="navbar navbar-inverse navbar-fixed-top">... <ul class="nav navbar-nav"> <li><a href="#section1">Section 1</a></li> ...</nav><!-- Section 1 --><div id="section1"> <h1>Section 1</h1> <p>Try to scroll this page and look at the navigation bar while scrolling!</p></div>...</body>
垂直Scrollspy例子
<body data-spy="scroll" data-target="#myScrollspy" data-offset="20"> <div class="container"> <div class="row"> <nav class="col-sm-3" id="myScrollspy"> <ul class="nav nav-pills nav-stacked"> <li><a href="#section1">Section 1</a></li> ... </ul> </nav> <div class="col-sm-9"> <div id="section1"> <h1>Section 1</h1> <p>Try to scroll this page and look at the navigation list while scrolling!</p> </div> ... </div> </div> </div></body>
Scrollspy的使用
使用Scrollspy只需在对应的HTML元素里添加几个关键的属性:
- data-spy=”scroll”
添加到需要滚动的元素中,比如最常见的body元素,或者container。
- data-target=”selector”
添加到需要滚动的元素中,selector指示的是控制滚动的元素比如”.navbar”, “#myScrollspy”。
- <a href=”#section”>section</a>
在控制滚动的元素中用link链接到对应的位置。注意链接的id要跟对应位置元素的id相匹配。例如,<div id=”section1”>与<a href=”#seciton1”。
0 0
- Bootstrap Scrollspy Plugin
- bootstrap之scrollspy
- Bootstrap插件scrollspy源码的学习
- Bootstrap 滚动监听(Scrollspy)插件
- bootstrap学习32---滚动监听scrollspy.js
- Bootstrap的js插件之滚动监听(scrollspy)
- Bootstrap 下拉菜单和滚动监听(Scrollspy)插件
- Bootstrap基础17——滚动监听scrollspy
- Bootstrap Carousel Plugin
- bootstrap-suggest-plugin
- HTML5-bootstrap-js plugin
- bootstrap scrollspy collapse 做能收缩能自动展开的菜单
- Bootstrap插件(二)——滚动监听(scrollspy.js)
- 20130121-使用Grails Bootstrap Plugin实现界面美化
- 使用Grails Bootstrap Plugin实现界面美化(作者:NEO)
- jQuery Validation Plugin提示修改为气泡使用bootstrap
- PlugIn
- plugIn
- android : Log
- UVA.136 Ugly Numbers (优先队列)
- js的一些知识点的总结
- sprintf的三个要点
- maven项目转web项目的一点小问题
- Bootstrap Scrollspy Plugin
- Django入门探索(一)
- RS232,RS485波形分析
- table中如何消除td间距
- CODEVS 1174 靶形数独
- 【Goodbye2014】Codeforces 500C New Year Book Reading【贪心+模拟】
- 腾讯云Badjs镜像使用入门
- 运算符重载-流插入运算符和流提取运算符的重载
- 在eclipse里的tomcat发布项目提示404错误,可能的情况