## 2.0 BOOTSTRAP JS PHILOSOPHY
These are the high-level design rules which guide the development of Bootstrap's plugin apis.
---
### DATA-ATTRIBUTE API
We believe you should be able to use all plugins provided by Bootstrap purely through the markup API without writing a single line of javascript.
We acknowledge that this isn't always the most performant and sometimes it may be desirable to turn this functionality off altogether. Therefore, as of 2.0 we provide the ability to disable the data attribute API by unbinding all events on the body namespaced with `'data-api'`. This looks like this:
$('body').off('.data-api')
To target a specific plugin, just include the plugins name as a namespace along with the data-api namespace like this:
$('body').off('.alert.data-api')
---
### PROGRAMATIC API
We also believe you should be able to use all plugins provided by Bootstrap purely through the JS API.
All public APIs should be single, chainable methods, and return the collection acted upon.
$(".btn.danger").button("toggle").addClass("fat")
All methods should accept an optional options object, a string which targets a particular method, or null which initiates the default behavior:
$("#myModal").modal() // initialized with defaults
$("#myModal").modal({ keyboard: false }) // initialized with now keyboard
$("#myModal").modal('show') // initializes and invokes show immediately afterqwe2
---
### OPTIONS
Options should be sparse and add universal value. We should pick the right defaults.
All plugins should have a default object which can be modified to effect all instance's default options. The defaults object should be available via `$.fn.plugin.defaults`.
$.fn.modal.defaults = { … }
An options definition should take the following form:
*noun*: *adjective* - describes or modifies a quality of an instance
examples:
backdrop: true
keyboard: false
placement: 'top'
---
### EVENTS
All events should have an infinitive and past participle form. The infinitive is fired just before an action takes place, the past participle on completion of the action.
show | shown
hide | hidden
---
### CONSTRUCTORS
Each plugin should expose it's raw constructor on a `Constructor` property -- accessed in the following way:
$.fn.popover.Constructor
---
### DATA ACCESSOR
Each plugin stores a copy of the invoked class on an object. This class instance can be accessed directly through jQuery's data API like this:
$('[rel=popover]').data('popover') instanceof $.fn.popover.Constructor
---
### DATA ATTRIBUTES
Data attributes should take the following form:
- data-{{verb}}={{plugin}} - defines main interaction
- data-target || href^=# - defined on "control" element (if element controls an element other than self)
- data-{{noun}} - defines class instance options
examples:
// control other targets
data-toggle="modal" data-target="#foo"
data-toggle="collapse" data-target="#foo" data-parent="#bar"
// defined on element they control
data-spy="scroll"
data-dismiss="modal"
data-dismiss="alert"
data-toggle="dropdown"
data-toggle="button"
data-toggle="buttons-checkbox"
data-toggle="buttons-radio"
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
736web_HTML手机电脑网站_网页源码移动端前端js效果_H5模板_自适应css源码ui组件.zip (208个子文件)
bootstrap.css 115KB
prettyPhoto.css 27KB
font-awesome-ie7.css 23KB
bootstrap-responsive.css 22KB
docs.css 21KB
font-awesome.css 14KB
style.css 14KB
extension.css 8KB
specimen_stylesheet.css 7KB
specimen_stylesheet.css 7KB
typography.css 5KB
grid_12-825-55-15.css 4KB
grid_12-825-55-15.css 4KB
stylesheet.css 4KB
responsive.css 2KB
prettify.css 817B
stylesheet.css 513B
stylesheet.css 482B
fontawesome-webfont.eot 38KB
OpenSans-SemiboldItalic-webfont.eot 34KB
OpenSans-Italic-webfont.eot 34KB
OpenSans-LightItalic-webfont.eot 34KB
OpenSans-BoldItalic-webfont.eot 33KB
OpenSans-ExtraBoldItalic-webfont.eot 33KB
OpenSans-Bold-webfont.eot 30KB
OpenSans-ExtraBold-webfont.eot 30KB
OpenSans-Semibold-webfont.eot 30KB
OpenSans-Regular-webfont.eot 29KB
OpenSans-Light-webfont.eot 29KB
bariol_regular-webfont.eot 29KB
com4s_m-webfont.eot 10KB
loader.gif 6KB
loader.gif 2KB
loader.gif 2KB
loader.gif 2KB
loader.gif 2KB
default_thumbnail.gif 227B
index.html 74KB
bariol_regular-demo.html 37KB
com4s_m-demo.html 31KB
demo.html 6KB
favicon.ico 1KB
1.jpg 90KB
02.jpg 20KB
06.jpg 20KB
03.jpg 20KB
04.jpg 20KB
05.jpg 20KB
01.jpg 20KB
full.jpg 15KB
01.jpg 6KB
03.jpg 6KB
01.jpg 6KB
02.jpg 6KB
03.jpg 6KB
02.jpg 5KB
01.jpg 3KB
02.jpg 3KB
14.jpg 3KB
15.jpg 3KB
11.jpg 3KB
04.jpg 3KB
10.jpg 3KB
07.jpg 3KB
05.jpg 3KB
09.jpg 3KB
06.jpg 3KB
12.jpg 3KB
13.jpg 3KB
16.jpg 3KB
03.jpg 3KB
08.jpg 3KB
jquery.js 93KB
bootstrap.js 55KB
jquery.prettyPhoto.js 31KB
bootstrap.min.js 25KB
jquery.flexslider-min.js 16KB
jquery.quicksand.js 14KB
prettify.js 13KB
jquery.easing.1.3.js 8KB
bootstrap-tooltip.js 8KB
bootstrap-typeahead.js 7KB
bootstrap-modal.js 6KB
jquery.backstretch.js 6KB
bootstrap-carousel.js 5KB
bootstrap-collapse.js 4KB
bootstrap-scrollspy.js 4KB
aura.js 4KB
waypoints.min.js 4KB
bootstrap-dropdown.js 4KB
application.js 4KB
jquery.gmap.min.js 4KB
bootstrap-tab.js 3KB
bootstrap-affix.js 3KB
bootstrap-popover.js 3KB
bootstrap-button.js 3KB
script.js 2KB
bootstrap-alert.js 2KB
form-validation.js 2KB
bootstrap-transition.js 2KB
共 208 条
- 1
- 2
- 3
资源评论
2201_75761617
- 粉丝: 20
- 资源: 7339
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功