diff --git a/.gitignore b/.gitignore index 496ee2ca6a..38ad090992 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.DS_Store \ No newline at end of file +.DS_Store +js/min \ No newline at end of file diff --git a/Makefile b/Makefile index b3dce89ac4..e5c083ae6f 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,10 @@ -VERSION=1.2.0 +VERSION=2.0.0 DATE=$(shell DATE) BOOTSTRAP = ./bootstrap.css BOOTSTRAP_MIN = ./bootstrap.min.css BOOTSTRAP_LESS = ./lib/bootstrap.less LESS_COMPESSOR ?= `which lessc` +UGLIFY_JS ?= `which uglifyjs` WATCHR ?= `which watchr` build: @@ -18,6 +19,24 @@ build: echo "You can install it by running: npm install less -g"; \ fi +uglify: + @@if test ! -z ${UGLIFY_JS}; then \ + mkdir -p js/min; \ + uglifyjs -o js/min/bootstrap-accordion.js js/bootstrap-accordion.js;\ + uglifyjs -o js/min/bootstrap-alerts.js js/bootstrap-alerts.js;\ + uglifyjs -o js/min/bootstrap-buttons.js js/bootstrap-buttons.js;\ + uglifyjs -o js/min/bootstrap-dropdown.js js/bootstrap-dropdown.js;\ + uglifyjs -o js/min/bootstrap-modal.js js/bootstrap-modal.js;\ + uglifyjs -o js/min/bootstrap-popover.js js/bootstrap-popover.js;\ + uglifyjs -o js/min/bootstrap-scrollspy.js js/bootstrap-scrollspy.js;\ + uglifyjs -o js/min/bootstrap-tabs.js js/bootstrap-tabs.js;\ + uglifyjs -o js/min/bootstrap-transitions.js js/bootstrap-transitions.js;\ + uglifyjs -o js/min/bootstrap-twipsy.js js/bootstrap-twipsy.js;\ + else \ + echo "You must have the UGLIFYJS minifier installed in order to minify Bootstrap's js."; \ + echo "You can install it by running: npm install uglify-js -g"; \ + fi + watch: @@if test ! -z ${WATCHR}; then \ echo "Watching less files..."; \ diff --git a/README.md b/README.md index ad51b16fc1..fd97265840 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Here's what the LESS version looks like: ``` -Or if you prefer, the standard css way: +Or if you prefer, the standard CSS way: ``` html @@ -72,7 +72,7 @@ http://groups.google.com/group/twitter-bootstrap Developers ---------- -We have included a makefile with convenience methods for working with the bootstrap library. +We have included a makefile with convenience methods for working with the Bootstrap library. + **build** - `make build` This will run the less compiler on the bootstrap lib and generate a bootstrap.css and bootstrap.min.css file. diff --git a/bootstrap.css b/bootstrap.css index 87e12fca0b..e7c0a732f2 100644 --- a/bootstrap.css +++ b/bootstrap.css @@ -1,16 +1,13 @@ /*! - * Bootstrap v1.2.0 + * Bootstrap v2.0.0 * * Copyright 2011 Twitter, Inc * Licensed under the Apache License v2.0 * http://www.apache.org/licenses/LICENSE-2.0 * * Designed and built with all the love in the world @twitter by @mdo and @fat. - * Date: Tue Nov 29 22:34:51 PST 2011 + * Date: Tue Nov 29 22:35:45 PST 2011 */ -/* Reset.less - * Props to Eric Meyer (meyerweb.com) for his CSS reset file. We're using an adapted version here that cuts out some of the reset HTML elements we will never need here (i.e., dfn, samp, etc). - * ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */ html, body { margin: 0; padding: 0; @@ -170,16 +167,6 @@ textarea { overflow: auto; vertical-align: top; } -/* Variables.less - * Variables to customize the look and feel of Bootstrap - * ----------------------------------------------------- */ -/* Mixins.less - * Snippets of reusable CSS to develop faster and keep code readable - * ----------------------------------------------------------------- */ -/* - * Scaffolding - * Basic and global styles for generating a grid system, structural layout, and page templates - * ------------------------------------------------------------------------------------------- */ body { margin: 0; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; @@ -344,9 +331,6 @@ a:hover { .offset11 { margin-left: 900px; } -/* Typography.less - * Headings, body text, lists, code, and more for a versatile and durable typography system - * ---------------------------------------------------------------------------------------- */ p { margin-bottom: 9px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; @@ -534,9 +518,6 @@ pre code { padding: 0; background-color: transparent; } -/* Forms.less - * Base styles for various input types, form layouts, and states - * ------------------------------------------------------------- */ form { margin-bottom: 18px; } @@ -676,7 +657,7 @@ select.span2, .uneditable-input.span2 { display: inline-block; float: none; - width: 150px; + width: 130px; margin-left: 0; } input.span3, @@ -685,7 +666,7 @@ select.span3, .uneditable-input.span3 { display: inline-block; float: none; - width: 250px; + width: 210px; margin-left: 0; } input.span4, @@ -694,7 +675,7 @@ select.span4, .uneditable-input.span4 { display: inline-block; float: none; - width: 350px; + width: 290px; margin-left: 0; } input.span5, @@ -703,7 +684,7 @@ select.span5, .uneditable-input.span5 { display: inline-block; float: none; - width: 450px; + width: 370px; margin-left: 0; } input.span6, @@ -712,7 +693,7 @@ select.span6, .uneditable-input.span6 { display: inline-block; float: none; - width: 550px; + width: 450px; margin-left: 0; } input.span7, @@ -721,7 +702,7 @@ select.span7, .uneditable-input.span7 { display: inline-block; float: none; - width: 650px; + width: 530px; margin-left: 0; } input.span8, @@ -730,7 +711,7 @@ select.span8, .uneditable-input.span8 { display: inline-block; float: none; - width: 750px; + width: 610px; margin-left: 0; } input.span9, @@ -739,7 +720,7 @@ select.span9, .uneditable-input.span9 { display: inline-block; float: none; - width: 850px; + width: 690px; margin-left: 0; } input.span10, @@ -748,7 +729,7 @@ select.span10, .uneditable-input.span10 { display: inline-block; float: none; - width: 950px; + width: 770px; margin-left: 0; } input.span11, @@ -757,7 +738,7 @@ select.span11, .uneditable-input.span11 { display: inline-block; float: none; - width: 1050px; + width: 850px; margin-left: 0; } input.span12, @@ -766,7 +747,7 @@ select.span12, .uneditable-input.span12 { display: inline-block; float: none; - width: 1150px; + width: 930px; margin-left: 0; } input.span13, @@ -775,7 +756,7 @@ select.span13, .uneditable-input.span13 { display: inline-block; float: none; - width: 1250px; + width: 1010px; margin-left: 0; } input.span14, @@ -784,7 +765,7 @@ select.span14, .uneditable-input.span14 { display: inline-block; float: none; - width: 1350px; + width: 1090px; margin-left: 0; } input.span15, @@ -793,7 +774,7 @@ select.span15, .uneditable-input.span15 { display: inline-block; float: none; - width: 1450px; + width: 1170px; margin-left: 0; } input.span16, @@ -802,7 +783,7 @@ select.span16, .uneditable-input.span16 { display: inline-block; float: none; - width: 1550px; + width: 1250px; margin-left: 0; } input[disabled], @@ -999,10 +980,6 @@ form .clearfix.success .input-prepend .add-on, form .clearfix.success .input-app .horizontal-form .form-actions { padding-left: 150px; } -/* - * Tables.less - * Tables for, you guessed it, tabular data - * ---------------------------------------- */ table { width: 100%; margin-bottom: 18px; @@ -1193,9 +1170,7 @@ table { .headerSortDown.purple { background-color: lighten(@purple, 40%); } -}*//* Patterns.less - * Repeatable UI elements outside the base styles provided from the scaffolding - * ---------------------------------------------------------------------------- */ +}*/ .navbar { height: 40px; overflow: visible; @@ -1638,7 +1613,7 @@ footer { border-color: #0064cd #0064cd #003f81; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); } -.btn:active { +.btn.active, .btn:active { -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); @@ -1874,6 +1849,19 @@ button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner { .fade.in { opacity: 1; } +.collapse { + -webkit-transition: height 0.35s ease; + -moz-transition: height 0.35s ease; + -ms-transition: height 0.35s ease; + -o-transition: height 0.35s ease; + transition: height 0.35s ease; + position: relative; + overflow: hidden; + height: 0; +} +.collapse.in { + height: auto; +} .label { padding: 1px 3px 2px; font-size: 9.75px; @@ -2264,11 +2252,11 @@ button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner { visibility: visible; padding: 5px; font-size: 11px; - filter: alpha(opacity=80); - -moz-opacity: 0.8; - opacity: 0.8; + filter: alpha(opacity=0); + -moz-opacity: 0; + opacity: 0; } -.twipsy.fade.in { +.twipsy.in { filter: alpha(opacity=80); -moz-opacity: 0.8; opacity: 0.8; @@ -2439,9 +2427,6 @@ button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner { -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); } -/* Responsive.less - * For phone and tablet devices - * ------------------------------------------------------------- */ @media (max-width: 480px) { .container { width: auto; diff --git a/bootstrap.min.css b/bootstrap.min.css index 32d4a9967a..fdd3db70ba 100644 --- a/bootstrap.min.css +++ b/bootstrap.min.css @@ -111,21 +111,21 @@ input[type=file]:focus,input[type=checkbox]:focus,select:focus{-webkit-box-shado .input-xlarge{width:270px;} .input-xxlarge{width:530px;} input.span1,textarea.span1,select.span1,.uneditable-input.span1{display:inline-block;float:none;width:50px;margin-left:0;} -input.span2,textarea.span2,select.span2,.uneditable-input.span2{display:inline-block;float:none;width:150px;margin-left:0;} -input.span3,textarea.span3,select.span3,.uneditable-input.span3{display:inline-block;float:none;width:250px;margin-left:0;} -input.span4,textarea.span4,select.span4,.uneditable-input.span4{display:inline-block;float:none;width:350px;margin-left:0;} -input.span5,textarea.span5,select.span5,.uneditable-input.span5{display:inline-block;float:none;width:450px;margin-left:0;} -input.span6,textarea.span6,select.span6,.uneditable-input.span6{display:inline-block;float:none;width:550px;margin-left:0;} -input.span7,textarea.span7,select.span7,.uneditable-input.span7{display:inline-block;float:none;width:650px;margin-left:0;} -input.span8,textarea.span8,select.span8,.uneditable-input.span8{display:inline-block;float:none;width:750px;margin-left:0;} -input.span9,textarea.span9,select.span9,.uneditable-input.span9{display:inline-block;float:none;width:850px;margin-left:0;} -input.span10,textarea.span10,select.span10,.uneditable-input.span10{display:inline-block;float:none;width:950px;margin-left:0;} -input.span11,textarea.span11,select.span11,.uneditable-input.span11{display:inline-block;float:none;width:1050px;margin-left:0;} -input.span12,textarea.span12,select.span12,.uneditable-input.span12{display:inline-block;float:none;width:1150px;margin-left:0;} -input.span13,textarea.span13,select.span13,.uneditable-input.span13{display:inline-block;float:none;width:1250px;margin-left:0;} -input.span14,textarea.span14,select.span14,.uneditable-input.span14{display:inline-block;float:none;width:1350px;margin-left:0;} -input.span15,textarea.span15,select.span15,.uneditable-input.span15{display:inline-block;float:none;width:1450px;margin-left:0;} -input.span16,textarea.span16,select.span16,.uneditable-input.span16{display:inline-block;float:none;width:1550px;margin-left:0;} +input.span2,textarea.span2,select.span2,.uneditable-input.span2{display:inline-block;float:none;width:130px;margin-left:0;} +input.span3,textarea.span3,select.span3,.uneditable-input.span3{display:inline-block;float:none;width:210px;margin-left:0;} +input.span4,textarea.span4,select.span4,.uneditable-input.span4{display:inline-block;float:none;width:290px;margin-left:0;} +input.span5,textarea.span5,select.span5,.uneditable-input.span5{display:inline-block;float:none;width:370px;margin-left:0;} +input.span6,textarea.span6,select.span6,.uneditable-input.span6{display:inline-block;float:none;width:450px;margin-left:0;} +input.span7,textarea.span7,select.span7,.uneditable-input.span7{display:inline-block;float:none;width:530px;margin-left:0;} +input.span8,textarea.span8,select.span8,.uneditable-input.span8{display:inline-block;float:none;width:610px;margin-left:0;} +input.span9,textarea.span9,select.span9,.uneditable-input.span9{display:inline-block;float:none;width:690px;margin-left:0;} +input.span10,textarea.span10,select.span10,.uneditable-input.span10{display:inline-block;float:none;width:770px;margin-left:0;} +input.span11,textarea.span11,select.span11,.uneditable-input.span11{display:inline-block;float:none;width:850px;margin-left:0;} +input.span12,textarea.span12,select.span12,.uneditable-input.span12{display:inline-block;float:none;width:930px;margin-left:0;} +input.span13,textarea.span13,select.span13,.uneditable-input.span13{display:inline-block;float:none;width:1010px;margin-left:0;} +input.span14,textarea.span14,select.span14,.uneditable-input.span14{display:inline-block;float:none;width:1090px;margin-left:0;} +input.span15,textarea.span15,select.span15,.uneditable-input.span15{display:inline-block;float:none;width:1170px;margin-left:0;} +input.span16,textarea.span16,select.span16,.uneditable-input.span16{display:inline-block;float:none;width:1250px;margin-left:0;} input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{background-color:#f5f5f5;border-color:#ddd;cursor:not-allowed;} form .clearfix.error>label,form .clearfix.error .help-block,form .clearfix.error .help-inline{color:#b94a48;} form .clearfix.error input,form .clearfix.error textarea{color:#b94a48;border-color:#ee5f5b;}form .clearfix.error input:focus,form .clearfix.error textarea:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7;} @@ -214,7 +214,7 @@ footer{padding-top:17px;margin-top:17px;border-top:1px solid #eee;} .btn{display:inline-block;padding:5px 14px 6px;font-size:13px;line-height:normal;color:#333;text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);background-color:#e6e6e6;background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6));background-image:-webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:-moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6);background-image:-ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:-o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-repeat:no-repeat;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);border:1px solid #ccc;border-bottom-color:#bbb;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);cursor:pointer;-webkit-transition:0.1s linear all;-moz-transition:0.1s linear all;-ms-transition:0.1s linear all;-o-transition:0.1s linear all;transition:0.1s linear all;}.btn:hover{color:#333;text-decoration:none;background-position:0 -15px;} .btn:focus{outline:1px dotted #666;} .btn.primary{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#0064cd;background-image:-khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));background-image:-moz-linear-gradient(top, #049cdb, #0064cd);background-image:-ms-linear-gradient(top, #049cdb, #0064cd);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));background-image:-webkit-linear-gradient(top, #049cdb, #0064cd);background-image:-o-linear-gradient(top, #049cdb, #0064cd);background-image:linear-gradient(top, #049cdb, #0064cd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0);border-color:#0064cd #0064cd #003f81;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);} -.btn:active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);} +.btn.active,.btn:active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.25),0 1px 2px rgba(0, 0, 0, 0.05);} .btn.disabled{cursor:default;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=65);-moz-opacity:0.65;opacity:0.65;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} .btn[disabled]{cursor:default;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=65);-moz-opacity:0.65;opacity:0.65;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} .btn.large{padding:9px 14px 9px;font-size:15px;line-height:normal;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} @@ -245,6 +245,7 @@ button.btn::-moz-focus-inner,input[type=submit].btn::-moz-focus-inner{padding:0; .alert-message.block-message.info{background-color:#ddf4fb;border-color:#c6edf9;} .well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #eee;border:1px solid rgba(0, 0, 0, 0.05);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);}.well blockquote{border-color:#ddd;border-color:rgba(0, 0, 0, 0.15);} .fade{-webkit-transition:opacity 0.15s linear;-moz-transition:opacity 0.15s linear;-ms-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear;opacity:0;}.fade.in{opacity:1;} +.collapse{-webkit-transition:height 0.35s ease;-moz-transition:height 0.35s ease;-ms-transition:height 0.35s ease;-o-transition:height 0.35s ease;transition:height 0.35s ease;position:relative;overflow:hidden;height:0;}.collapse.in{height:auto;} .label{padding:1px 3px 2px;font-size:9.75px;font-weight:bold;color:#ffffff;text-transform:uppercase;background-color:#bfbfbf;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}.label.important{background-color:#c43c35;} .label.warning{background-color:#f89406;} .label.success{background-color:#46a546;} @@ -296,7 +297,7 @@ button.btn::-moz-focus-inner,input[type=submit].btn::-moz-focus-inner{padding:0; .modal-footer{padding:14px 15px 15px;margin-bottom:0;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;zoom:1;}.modal-footer:before,.modal-footer:after{display:table;*display:inline;content:"";zoom:1;} .modal-footer:after{clear:both;} .modal-footer .btn{float:right;margin-left:5px;} -.twipsy{position:absolute;z-index:1000;display:block;visibility:visible;padding:5px;font-size:11px;filter:alpha(opacity=80);-moz-opacity:0.8;opacity:0.8;}.twipsy.fade.in{filter:alpha(opacity=80);-moz-opacity:0.8;opacity:0.8;} +.twipsy{position:absolute;z-index:1000;display:block;visibility:visible;padding:5px;font-size:11px;filter:alpha(opacity=0);-moz-opacity:0;opacity:0;}.twipsy.in{filter:alpha(opacity=80);-moz-opacity:0.8;opacity:0.8;} .twipsy.above .twipsy-arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;} .twipsy.left .twipsy-arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;} .twipsy.below .twipsy-arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;} diff --git a/docs/assets/css/docs.css b/docs/assets/css/docs.css index 6c57fddabd..ec3cd83cb2 100644 --- a/docs/assets/css/docs.css +++ b/docs/assets/css/docs.css @@ -330,6 +330,13 @@ body > .navbar-fixed .brand:hover { margin-left: 10px; } +/* scrollspy docs */ + +.scrollspy-example { + overflow: auto; + height: 200px; + position: relative; +} /* Popover docs -------------------------------------------------- */ @@ -492,3 +499,19 @@ h2 + table { } } +#accordion dt a{ + display:block; + padding: 9px 15px; + line-height: 1; + background-color: whiteSmoke; + border: 1px solid #EEE; + border-top-color: #fff; +} + +#accordion dt:first-child a { + border-top-color:#eee; +} + +#accordion dd p { + padding: 10px; +} diff --git a/docs/base-css.html b/docs/base-css.html index 48704cbd49..bab55f0e44 100644 --- a/docs/base-css.html +++ b/docs/base-css.html @@ -37,7 +37,7 @@
$('#my-modal').modal(options)+
$('#myModal').modal(options)
backdrop | boolean | -false | +true | Includes a modal-backdrop element |
keyboard | boolean | -false | +true | Closes the modal when escape key is pressed |
show | boolean | -false | +true | Opens modal on class initialization |
You can activate modals on your page easily without having to write a single line of javascript. Just give an element a data-controls-modal
attribute which corresponds to a modal element id, and when clicked, it will launch your modal. To add modal options, just include them as data attributes as well.
You can activate modals on your page easily without having to write a single line of javascript. Just set data-toggle="modal"
on a controller element with a data-target="#foo"
or href="#foo"
which corresponds to a modal element id, and when clicked, it will launch your modal. To add modal options, just include them as additoinal data attributes.
-<a class="btn" data-controls-modal="my-modal" data-backdrop="true" >Launch Modal</a> +<a class="btn" data-toggle="modal" href="#myModal" >Launch Modal</a>-
Notice If you want your modal to animate in and out, just add a .fade
class to your .modal
element (refer to the demo to see this in action).
Notice If you want your modal to animate in and out, just add a .fade
class to the .modal
element (refer to the demo to see this in action).
Activates your content as a modal. Accepts an optional options object
.
-$('#my-modal').modal({ - closeOnEscape: true +$('#myModal').modal({ + keyboard: false })
Manually toggles a modal.
-$('#my-modal').modal('toggle')+
$('#myModal').modal('toggle')
Manually opens a modal.
-$('#my-modal').modal('show')+
$('#myModal').modal('show')
Manually hides a modal.
-$('#my-modal').modal('hide')-
Returns an elements modal class instance.
-$('#my-modal').modal(true)-
Notice Alternatively, this can be retrieved with $().data('modal')
.
$('#myModal').modal('hide')
Bootstrap's modal class exposes a few events for hooking into modal functionality.
-$('#my-modal').bind('hidden', function () { +$('#myModal').bind('hidden', function () { // do something ... })
$('#navbar').dropdown()+
$('.dropdown-toggle').dropdown()
To quickly add dropdown functionality to any nav element, use the data-dropdown
attribute. Any valid bootstrap dropdown will automatically be activated.
To quickly add dropdown functionality to any element just add data-toggle="dropdown"
. Any valid bootstrap dropdown will automatically be activated.
<ul class="tabs"> <li class="active"><a href="#">Home</a></li> - <li class="dropdown" data-dropdown="true" > - <a href="#" class="dropdown-toggle">Dropdown</a> + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a> <ul class="dropdown-menu"> <li><a href="#">Secondary link</a></li> <li><a href="#">Something else here</a></li> @@ -310,7 +331,7 @@ $('#my-modal').bind('hidden', function () {
$('.tabs').tabs()+
$('#myTab').tab('show')
You can activate a tab or pill navigation without writing any javascript by simply giving them a data-tabs
or data-pills
attribute.
<ul class="tabs" data-tabs="tabs" >...</ul>+
You can activate a tab or pill navigation without writing any javascript by simply specifying data-toggle="tab"
or data-toggle="pill"
on an element.
+<ul class="tabs"> + <li><a href="#home" data-toggle="tab">Home</a></li> + <li><a href="#profile" data-toggle="tab">Profile</a></li> + <li><a href="http://twitter.com/fat">twitter</a></li> +</ul>
- Activates tab and pill functionality for a given container. Tab links should reference id's in the document. + Activates tab functionality for a given element controller. Tab should have either a `data-target` or an `href` referencing a node in the dom.
<ul class="tabs"> @@ -410,31 +475,67 @@ $('#my-modal').bind('hidden', function () { <script> $(function () { - $('.tabs').tabs() + $('.tabs a:last').tab('show') }) </script>+
Event | +Description | +
---|---|
show | +This event fires on tab show, but before the new tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively. |
+
show | +This event fires on tab show after a tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively. |
+
+$('a[data-toggle="tab"]').bind('shown', function (e) { + e.target // activated tab + e.relatedTarget // previous tab +})
Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.
-Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.
-Banksy do proident, brooklyn photo booth delectus sunt artisan sed organic exercitation eiusmod four loko. Quis tattooed iphone esse aliqua. Master cleanse vero fixie mcsweeney's. Ethical portland aute, irony food truck pitchfork lomo eu anim. Aesthetic blog DIY, ethical beard leggings tofu consequat whatever cardigan nostrud. Helvetica you probably haven't heard of them carles, marfa veniam occaecat lomo before they sold out in shoreditch scenester sustainable thundercats. Consectetur tofu craft beer, mollit brunch fap echo park pitchfork mustache dolor.
-Sunt qui biodiesel mollit officia, fanny pack put a bird on it thundercats seitan squid ad wolf bicycle rights blog. Et aute readymade farm-to-table carles 8-bit, nesciunt nulla etsy adipisicing organic ea. Master cleanse mollit high life, next level Austin nesciunt american apparel twee mustache adipisicing reprehenderit hoodie portland irony. Aliqua tofu quinoa +1 commodo eiusmod. High life williamsburg cupidatat twee homo leggings. Four loko vinyl DIY consectetur nisi, marfa retro keffiyeh vegan. Fanny pack viral retro consectetur gentrify fap.
-Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.
+Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.
+Banksy do proident, brooklyn photo booth delectus sunt artisan sed organic exercitation eiusmod four loko. Quis tattooed iphone esse aliqua. Master cleanse vero fixie mcsweeney's. Ethical portland aute, irony food truck pitchfork lomo eu anim. Aesthetic blog DIY, ethical beard leggings tofu consequat whatever cardigan nostrud. Helvetica you probably haven't heard of them carles, marfa veniam occaecat lomo before they sold out in shoreditch scenester sustainable thundercats. Consectetur tofu craft beer, mollit brunch fap echo park pitchfork mustache dolor.
+Sunt qui biodiesel mollit officia, fanny pack put a bird on it thundercats seitan squid ad wolf bicycle rights blog. Et aute readymade farm-to-table carles 8-bit, nesciunt nulla etsy adipisicing organic ea. Master cleanse mollit high life, next level Austin nesciunt american apparel twee mustache adipisicing reprehenderit hoodie portland irony. Aliqua tofu quinoa +1 commodo eiusmod. High life williamsburg cupidatat twee homo leggings. Four loko vinyl DIY consectetur nisi, marfa retro keffiyeh vegan. Fanny pack viral retro consectetur gentrify fap.
+Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.
+Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.
delay showing/hiding the tooltip (ms)
+If a number is supplied, delay is applied to both hide/show
+Object structure is: delay: { show: 500, hide: 100 }
Notice Individual twipsy instance options can alternatively be specified through the use of data attributes.
+Attaches a twipsy handler to an element collection.
@@ -538,22 +622,11 @@ $('#my-modal').bind('hidden', function () {Hides an elements twipsy.
$('#element').twipsy('hide')-
Returns an elements twipsy class instance.
-$('#element').twipsy(true)-
Notice Alternatively, this can be retrieved with $().data('twipsy')
.
Tight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan whatever keytar, scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral.
Notice Individual popover instance options can alternatively be specified through the use of data attributes.
++ For performance reasons, the Twipsy and Popover data-apis are opt in. If you would like to use them just set the live flag to true, however we recommend you know what you are doing if you do that. :) +
Initializes popovers for an element collection.
@@ -663,28 +711,17 @@ $('#my-modal').bind('hidden', function () {$('#element').popover('hide')
$(".alert-message").alert()
Just add a data-alert
attribute to your alert messages to automatically give them close functionality.
Just add data-dismiss="alert"
to your close button to automatically give an alert close functionality.
<a class="close" data-dismiss="alert" href="#">×</a>
Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the .fade
and .in
class already applied to them.
Closes an alert.
$(".alert-message").alert('close')