"Toogle Hide with Class Change"
Bootstrap 3.2.0 Snippet by Marnoweb

1
2
3
4
5
6
7
8
9
10
11
12
13
<link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div class="row">
<button type="button" class="btn btn-info btn-sm" title="Click me"><span id="glyph" class="glyphicon glyphicon-minus"></span></button>
<figure class="pull-left "><img class="img-responsive img-rounded" alt="image" src="http://www.placehold.it/200.png/ddd"/>
<figcaption class="text-center"><strong>One fine caption</strong></figcaption>
</figure>
</div>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
button{position:fixed; left:0; border-radius:100% !important;}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
$(function(){
var ele = $('figure');
var plus = $('#glyph');
var btn =$('button')
$( "button" ).click(function() {
plus.toggleClass("glyphicon-minus glyphicon-plus")
btn.toggleClass("btn-danger btn-info")
ele.toggle('slow');
});
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: