## 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"
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
基于Hadoop的简单网盘实现源代码.rar (190个子文件)
UploadServlet.class 5KB
HdfsDAO.class 4KB
LoginServlet.class 2KB
DeleteFileServlet.class 2KB
DownloadServlet.class 2KB
UserBeanCl.class 2KB
DocumentServlet.class 2KB
LogoutServlet.class 1KB
UserBean.class 1KB
ConnDB.class 853B
.classpath 12KB
org.eclipse.wst.common.component 476B
org.eclipse.wst.jsdt.ui.superType.container 49B
bootmetro.css 176KB
bootmetro-icons.css 72KB
_bootmetro.css 45KB
demo.css 37KB
_metro-ui-dark.css 32KB
metro-ui-dark.css 32KB
_metro-ui-light.css 31KB
metro-ui-light.css 24KB
bootmetro-responsive.css 23KB
bootmetro-ui-light.css 22KB
bootmetro-ui-light.css 22KB
select2.css 19KB
datepicker.css 16KB
docs.css 15KB
site.css 5KB
prettify.css 817B
IcoMoon.eot 173KB
opensans-bold-webfont.eot 20KB
opensans-semibold-webfont.eot 20KB
opensans-regular-webfont.eot 19KB
opensans-light-webfont.eot 19KB
progress-indeterminate-ring-dark.gif 31KB
progress-indeterminate-ring-light.gif 31KB
progress-indeterminate-ring-light-small.gif 17KB
progress-indeterminate-ring-dark-small.gif 17KB
progress-indeterminate-dark.gif 6KB
progress-indeterminate-light.gif 6KB
favicon.ico 1KB
aspectjtools-1.6.11.jar 8.51MB
hadoop-core-1.1.2.jar 3.85MB
core-3.1.1.jar 3.4MB
hadoop-test-1.1.2.jar 2.65MB
mockito-all-1.8.5.jar 1.35MB
mysql-connector-java-commercial-5.1.25-bin.jar 828KB
commons-math-2.1.jar 813KB
hsqldb-1.8.0.10.jar 690KB
jersey-server-1.8.jar 678KB
jackson-mapper-asl-1.8.8.jar 653KB
commons-collections-3.2.1.jar 562KB
jetty-6.1.26.jar 527KB
jersey-core-1.8.jar 447KB
log4j-1.2.15.jar 383KB
jets3t-0.6.1.jar 314KB
hadoop-tools-1.1.2.jar 299KB
commons-configuration-1.6.jar 292KB
commons-httpclient-3.0.1.jar 273KB
commons-net-3.1.jar 267KB
commons-lang-2.4.jar 256KB
jackson-core-asl-1.8.8.jar 222KB
jdeb-0.8.jar 216KB
commons-beanutils-core-1.8.0.jar 201KB
junit-4.5.jar 194KB
commons-beanutils-1.7.0.jar 184KB
jsch-0.1.42.jar 181KB
commons-io-2.4.jar 181KB
jetty-util-6.1.26.jar 173KB
commons-io-2.1.jar 159KB
jersey-json-1.8.jar 144KB
commons-digester-1.8.jar 140KB
hadoop-examples-1.1.2.jar 139KB
servlet-api-2.5-20081211.jar 131KB
aspectjrt-1.6.11.jar 113KB
commons-el-1.0.jar 110KB
commons-fileupload-1.3.1.jar 67KB
hadoop-fairscheduler-1.1.2.jar 66KB
oro-2.0.8.jar 64KB
commons-logging-1.1.1.jar 59KB
hadoop-capacity-scheduler-1.1.2.jar 57KB
commons-codec-1.4.jar 57KB
asm-3.2.jar 42KB
commons-cli-1.2.jar 40KB
commons-logging-api-1.0.4.jar 26KB
slf4j-api-1.4.3.jar 15KB
xmlenc-0.52.jar 15KB
commons-daemon-1.0.1.jar 13KB
kfs-0.2.2.jar 11KB
hadoop-thriftfs-1.1.2.jar 10KB
slf4j-log4j12-1.4.3.jar 8KB
hadoop-ant-1.1.2.jar 7KB
hadoop-minicluster-1.1.2.jar 414B
hadoop-client-1.1.2.jar 410B
UploadServlet.java 5KB
HdfsDAO.java 4KB
LoginServlet.java 2KB
DownloadServlet.java 2KB
DeleteFileServlet.java 1KB
DocumentServlet.java 1KB
共 190 条
- 1
- 2
资源评论
源码时间
- 粉丝: 1
- 资源: 79
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- copy2txt,一个连续拷贝并降拷贝结果保存至txt文本的小工具
- p1008打印机设置.rar
- 医学图像分割数据集:肺部癌症(Lung)切片分割【包含3个切面划分好的数据集(2类别)、标签文件、可视化代码】
- sitka-weather-2014.csv
- 基于python+CNN+opencv实现的驾驶员分心驾驶状态识别源码+数据+使用说明.zip
- xshell6安装包,包含xshell与xftp
- 基于python+CNN+opencv实现的驾驶员分心驾驶状态识别源码+数据+使用说明.zip
- 网站表白源码网站表白源码
- 行业大模型调研报告0513.pdf
- 植物大战僵尸杂交版v2.0安装程序.exe
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功