## 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"
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
bootstrap后台管理模板,商业模板themeforest-kamarel (147个子文件)
bootstrap.css 124KB
bootstrap.min.css 103KB
thekamarel.css 92KB
bootstrap.css 84KB
font-awesome.css 27KB
bootstrap-responsive.css 22KB
font-awesome.min.css 22KB
bootstrap-responsive.min.css 16KB
theme.default.css 14KB
bootstrap-editable.css 14KB
fullcalendar.css 11KB
thekamarel-responsive.css 11KB
bootstrap-responsive.css 11KB
toggle-switch.css 8KB
jquery.selectBoxIt.css 7KB
datepicker.css 5KB
colorbox.css 5KB
jquery.jgrowl.css 4KB
slider.css 4KB
jquery.jgrowl.min.css 3KB
colorpicker.css 2KB
documenter_style.css 2KB
bootstrap-tags.css 2KB
styles.css 1KB
bootstrap-wysihtml5-0.0.2.css 985B
prettify.css 815B
fullcalendar.print.css 668B
fontawesome-webfont.eot 37KB
bg.gif 14KB
loader.gif 2KB
loading.gif 2KB
ajax-loader.gif 2KB
3dot-divider-dark.gif 1KB
2dot-divider-dark.gif 1KB
sort.gif 175B
sort-asc.gif 159B
sort-desc.gif 159B
index.html 199KB
tables.html 158KB
buttons.html 157KB
widgets.html 108KB
interface.html 81KB
typography.html 71KB
grid.html 59KB
charts.html 55KB
gallery.html 50KB
common-form.html 45KB
index.html 45KB
calendar.html 44KB
validation-form.html 41KB
form-wizard.html 39KB
404.html 2KB
login.html 2KB
ici.jpg 36KB
homer-avatar.jpg 5KB
zoidberg-avatar.jpg 5KB
peter-avatar.jpg 4KB
rimmer-avatar.jpg 4KB
wysihtml5-0.3.0.js 324KB
raphael.js 290KB
jquery-1.9.1.js 262KB
jquery.js 242KB
bootstrap-editable.js 204KB
fullcalendar.js 125KB
jquery.sparkline.js 120KB
jquery.flot.js 116KB
wysihtml5-0.3.0_rc2.min.js 109KB
jquery.selectBoxIt.js 104KB
jquery-1.9.1.min.js 90KB
raphael.2.1.0.min.js 88KB
jquery-ui-1.10.3.custom.js 83KB
jquery.manifest.js 77KB
bootstrap-editable.min.js 64KB
bootstrap.js 60KB
jquery.tablesorter.js 51KB
fullcalendar.min.js 48KB
jquery-ui-1.10.2.custom.min.js 48KB
jquery.tablesorter.widgets.js 47KB
parsley.js 44KB
jquery.sparkline.min.js 43KB
jquery.flot.min.js 37KB
justgage.js 30KB
bootstrap.min.js 28KB
jquery.colorbox.js 27KB
jquery.manifest.min.js 23KB
jquery.flot.pie.js 23KB
bootstrap-wysihtml5.js 22KB
jquery.tablesorter.min.js 22KB
bootstrap-min.js 22KB
jquery.selectBoxIt.min.js 21KB
jquery.tablesorter.pager.js 21KB
jquery.tablesorter.widgets.min.js 19KB
parsley.min.js 18KB
bootstrap-tags.js 16KB
jquery.jgrowl.js 14KB
bootstrap-datepicker.js 13KB
prettify.js 13KB
bootstrap-colorpicker.js 13KB
bootstrap-multiselect.js 13KB
thekamarel.js 12KB
共 147 条
- 1
- 2
redspear119
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- python-leetcode面试题解之第157题用Read4读取N个字符-题解.zip
- python-leetcode面试题解之第156题上下翻转二叉树-题解.zip
- python-leetcode面试题解之第155题最小栈-题解.zip
- python-leetcode面试题解之第153题寻找旋转排序数组中的最小值-题解.zip
- python-leetcode面试题解之第152题乘积最大子数组-题解.zip
- python-leetcode面试题解之第151题反转字符串中的单词-题解.zip
- python-leetcode面试题解之第150题逆波兰表达式求值-题解.zip
- python-leetcode面试题解之第149题直线上最多的点数-题解.zip
- python-leetcode面试题解之第148题排序链表-题解.zip
- python-leetcode面试题解之第147题对链表进行插入排序-题解.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页