最新回答 / 喝水的饅頭
<!DOCTYPE html><html lang="en"><head> ? ?<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ? ?<title>Title</title> ? ?<link rel="stylesheet" href="../bootstrap.css"></head><body><h...
2016-12-19
參考完bootstrap在線api中的js插件的文檔之后,找到了所有按鈕都用不了的原因:
—————————————————————————————————————
data 屬性
你可以僅僅通過 data 屬性 API 就能使用所有的 Bootstrap 插件,無需寫一行 JavaScript 代碼。這是 Bootstrap 中的一等 API,也應該是你的首選方式。
——————————————————————————————
于是只要在script標簽里加上“$(document).off('.data-api')”這句就可以了,就是告訴html所有bootstrap的api均可以使用。
—————————————————————————————————————
data 屬性
你可以僅僅通過 data 屬性 API 就能使用所有的 Bootstrap 插件,無需寫一行 JavaScript 代碼。這是 Bootstrap 中的一等 API,也應該是你的首選方式。
——————————————————————————————
于是只要在script標簽里加上“$(document).off('.data-api')”這句就可以了,就是告訴html所有bootstrap的api均可以使用。
2016-12-15
我來說吧。
1.將data-complete-text="Loading finished"改成data-reset-text="確認"。
2.$(function() {
$("#mybutton").click(function(){
$(this).button('loading').delay(1000).queue(function() {
$(this).button('reset');
$(this).dequeue(); }); });});
這樣就實現了:確認->loading..->確認 的循環.
1.將data-complete-text="Loading finished"改成data-reset-text="確認"。
2.$(function() {
$("#mybutton").click(function(){
$(this).button('loading').delay(1000).queue(function() {
$(this).button('reset');
$(this).dequeue(); }); });});
這樣就實現了:確認->loading..->確認 的循環.
2016-12-12