Skip to content

Commit

Permalink
Enable and disable examples
Browse files Browse the repository at this point in the history
  • Loading branch information
asumaran committed Aug 14, 2013
1 parent adae792 commit d22df50
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
5 changes: 5 additions & 0 deletions button.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<h2>Single Button</h2>

<a id="btn1" href="#" class="btn btn-single">Botón</a>
<a href="#" id="activate-btn-single">Activar</a>
<a href="#" id="deactivate-btn-single">Desactivar</a>
<a href="#" id="toggle-btn-single">Alternar</a>
<a href="#" id="disable-btn-single">Deshabilitar</a>
<a href="#" id="enable-btn-single">Habilitar</a>

<h3>Radio Button Behaviour (Unique option)</h3>

Expand Down
35 changes: 30 additions & 5 deletions scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,50 @@ $(function(){

$('.btn-single').button({
onActivate: function () {
console.log('on active callback');
console.log('on activate callback');
},
onDeactivate: function () {
console.log('on deactive callback');
console.log('on deactivate callback');
}
});

$('#deactivate-btn-single').on('click', function(){
$('.btn-single').button('deactivate');
return false;
});

$('#activate-btn-single').on('click', function(){
$('.btn-single').button('activate');
return false;
});

$('#toggle-btn-single').on('click', function(){
$('.btn-single').button('toggle');
return false;
});

$('#disable-btn-single').on('click', function(){
$('.btn-single').button('disable');
return false;
});

$('#enable-btn-single').on('click', function(){
$('.btn-single').button('enable');
return false;
});

$('.btn-unique').button({
onActivate: function () {
console.log('on active callback');
console.log('on activate callback');
},
onDeactivate: function () {
console.log('on deactive callback');
console.log('on deactivate callback');
}
});

$('.btn-multiple').button({
onActivate: function () {
console.log('on active callback');
console.log('on activate callback');
},
onDeactivate: function () {
console.log('on deactive callback');
Expand Down
9 changes: 8 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.btn{
body{
font-family: helvetica;
}

.btn{
font-weight: bold;
display: inline-block;
padding: 10px 15px;
Expand All @@ -16,4 +19,8 @@
.btn:active, .btn.active{
box-shadow: inset 0 0 10px black;
background-color: #ccc;
}

.btn.disabled{
opacity: 0.4;
}

0 comments on commit d22df50

Please sign in to comment.