.toggle() text in a button
.toggle() text in a button
by labanino
HTML
<script src="http://www.outcoding.com/joe_edis_mockups/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="http://www.outcoding.com/joe_edis_mockups/css/bootstrap.min.css">
<div class="location">
<a href="#" rel="popover" data-toggle="popover" data-placement="top">Fire popover</a>
<span class="popover">
<button class="btn text-btn">Toggle me!</button>
<button class="btn text-btn toggle-text">Un-Tobble me</button>
</span>
</div>
CSS
.toggle-text {
display:none;
}
.location {
margin:100px 0 0 150px;
}
JavaScript
$('[rel=popover]').popover({
html: true,
content: function () {
return $(this).siblings('.popover').html();
}
});
/* TOGGLE BUTTON TEXT */
$('.text-btn').click(function () {
/*alert('What's going on!');*/
$('.text-btn').toggle();
});
/* end TOGGLE BUTTON TEXT */