add buttons behaviour

This commit is contained in:
Kai Hendry
2011-12-04 22:08:42 +08:00
parent cd80e503b4
commit dc9ed642e7
2 changed files with 62 additions and 124 deletions

62
bootstrap-buttons.js vendored Normal file
View File

@@ -0,0 +1,62 @@
/* ============================================================
* bootstrap-buttons.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#buttons
* ============================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
!function( $ ){
"use strict"
function setState(el, state) {
var d = 'disabled'
, $el = $(el)
, data = $el.data()
state = state + 'Text'
data.resetText || $el.data('resetText', $el.html())
$el.html( data[state] || $.fn.button.defaults[state] )
state == 'loadingText' ?
$el.addClass(d).attr(d, d) :
$el.removeClass(d).removeAttr(d)
}
function toggle(el) {
$(el).toggleClass('active')
}
$.fn.button = function(options) {
return this.each(function () {
if (options == 'toggle') {
return toggle(this)
}
options && setState(this, options)
})
}
$.fn.button.defaults = {
loadingText: 'loading...'
}
$(function () {
$('body').delegate('.btn[data-toggle]', 'click', function () {
$(this).button('toggle')
})
})
}( window.jQuery || window.ender );

View File

@@ -1,124 +0,0 @@
html,
body {
height: 100%;
}
.humane {
position: fixed;
-moz-transition: all 0.3s ease-out;
-webkit-transition: all 0.3s ease-out;
-ms-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
z-index: -1;
}
.humane.humane-animate,
.humane.humane-js-animate {
z-index: 100000;
}
.humane {
font-family: Ubuntu, Verdana, sans-serif;
line-height: 40px;
font-size: 35px;
top: 25%;
left: 25%;
opacity: 0;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
width: 50%;
min-height: 40px;
padding: 30px;
text-align: center;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADICAYAAAAp8ov1AAAABmJLR0QA/wD/AP+gvaeTAAAAc0lEQVQokb2RQQ6EMAwDx/7/n80BtIEC3RYhLlXrVLGTAYiBWBIGtkPSP01SfreTVoV5re9Rcee1scwDk9NurbR62sZJcpzy9O+2X5KsXabyPaQFYNuvkqkRviDTp9Vs8opC0TpkHvJtVjeReW/5kEyX1gKeLEKE9peeWAAAAABJRU5ErkJggg==');
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #000), color-stop(1, rgba(0,0,0,0.90))) no-repeat;
background: -moz-linear-gradient(top, #000 0%, rgba(0,0,0,0.90) 100%) no-repeat;
background: -webkit-linear-gradient(top, #000 0%, rgba(0,0,0,0.90) 100%) no-repeat;
background: -ms-linear-gradient(top, #000 0%, rgba(0,0,0,0.90) 100%) no-repeat;
background: -o-linear-gradient(top, #000 0%, rgba(0,0,0,0.90) 100%) no-repeat;
background: linear-gradient(top, #000 0%, rgba(0,0,0,0.90) 100%) no-repeat;
*background-color: #000;
color: #fff;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
-ms-border-radius: 15px;
-o-border-radius: 15px;
border-radius: 15px;
text-shadow: 0 -1px 1px #ddd;
-moz-box-shadow: 0 15px 15px -15px #000;
-webkit-box-shadow: 0 15px 15px -15px #000;
-ms-box-shadow: 0 15px 15px -15px #000;
-o-box-shadow: 0 15px 15px -15px #000;
box-shadow: 0 15px 15px -15px #000;
-moz-transform: scale(0.1);
-webkit-transform: scale(0.1);
-ms-transform: scale(0.1);
-o-transform: scale(0.1);
transform: scale(0.1);
}
.humane p,
.humane ul {
margin: 0;
padding: 0;
}
.humane ul {
list-style: none;
}
.humane.humane-info {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADICAYAAAAp8ov1AAAABmJLR0QA/wD/AP+gvaeTAAAAQElEQVQokWNgYEj5z8TAwPCfiYGBgQGVIEKMTG2DTYwRVez/IHIaNcUGyBnYgpORel6gpvFEJhBqpxIaG8/AAADsKDq/HhYQ2AAAAABJRU5ErkJggg==');
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #000064), color-stop(1, rgba(0,0,100,0.90))) no-repeat;
background: -moz-linear-gradient(top, #000064 0%, rgba(0,0,100,0.90) 100%) no-repeat;
background: -webkit-linear-gradient(top, #000064 0%, rgba(0,0,100,0.90) 100%) no-repeat;
background: -ms-linear-gradient(top, #000064 0%, rgba(0,0,100,0.90) 100%) no-repeat;
background: -o-linear-gradient(top, #000064 0%, rgba(0,0,100,0.90) 100%) no-repeat;
background: linear-gradient(top, #000064 0%, rgba(0,0,100,0.90) 100%) no-repeat;
*background-color: #030;
}
.humane.humane-success {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADICAYAAAAp8ov1AAAABmJLR0QA/wD/AP+gvaeTAAAAPklEQVQokWNgSGH4z8TAACEYUAkixMjUNsjEGFHF/g8ip1FVbGCcgS04GannBaoaT1wCwWkvmXbQ2HgGBgYA8Yw6v+m4Kh8AAAAASUVORK5CYII=');
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #006400), color-stop(1, rgba(0,100,0,0.90))) no-repeat;
background: -moz-linear-gradient(top, #006400 0%, rgba(0,100,0,0.90) 100%) no-repeat;
background: -webkit-linear-gradient(top, #006400 0%, rgba(0,100,0,0.90) 100%) no-repeat;
background: -ms-linear-gradient(top, #006400 0%, rgba(0,100,0,0.90) 100%) no-repeat;
background: -o-linear-gradient(top, #006400 0%, rgba(0,100,0,0.90) 100%) no-repeat;
background: linear-gradient(top, #006400 0%, rgba(0,100,0,0.90) 100%) no-repeat;
*background-color: #030;
}
.humane.humane-error {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADICAYAAAAp8ov1AAAABmJLR0QA/wD/AP+gvaeTAAAAPklEQVQokWNIYWD4z8QAJRhQCSLEyNQ2uMQYUcX+DyKnUVdsQJyBLTgZqecF6hpPVALBaS+ZdtDYeAYGBgYA9vA6v4OR3MkAAAAASUVORK5CYII=');
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #640000), color-stop(1, rgba(100,0,0,0.90))) no-repeat;
background: -moz-linear-gradient(top, #640000 0%, rgba(100,0,0,0.90) 100%) no-repeat;
background: -webkit-linear-gradient(top, #640000 0%, rgba(100,0,0,0.90) 100%) no-repeat;
background: -ms-linear-gradient(top, #640000 0%, rgba(100,0,0,0.90) 100%) no-repeat;
background: -o-linear-gradient(top, #640000 0%, rgba(100,0,0,0.90) 100%) no-repeat;
background: linear-gradient(top, #640000 0%, rgba(100,0,0,0.90) 100%) no-repeat;
*background-color: #300;
}
.humane.humane-animate {
opacity: 1;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
-moz-transform: scale(1);
-webkit-transform: scale(1);
-ms-transform: scale(1);
-o-transform: scale(1);
transform: scale(1);
}
.humane.humane-animate:hover {
opacity: 0.6;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60);
-moz-transform: scale(0.8);
-webkit-transform: scale(0.8);
-ms-transform: scale(0.8);
-o-transform: scale(0.8);
transform: scale(0.8);
}
.humane.humane-js-animate {
opacity: 1;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
-moz-transform: scale(1);
-webkit-transform: scale(1);
-ms-transform: scale(1);
-o-transform: scale(1);
transform: scale(1);
}
.humane.humane-js-animate:hover {
opacity: 0.6;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60);
}