<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<div id="myModal" class="modal hide fade">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
<h3>Modal header</h3>
</div>
<div class="modal-body">
<p>
<a href="#" rel="tooltip" title="first tooltip">
hover over me
</a>
</p>
<p>
<a class="btn"
data-content="And here's some amazing content.
It's very engaging. right?" rel="popover" href="#"
data-original-title="A Title">
Click to toggle popover
</a>
</p>
<p class="show-z-index">hover for z-indices:</p>
</div>
<div class="modal-footer">
<a href="#" class="btn">Close</a>
<a href="#" class="btn btn-primary">Save changes</a>
</div>
</div>
<p>Try This:</p>
<p>
<a href="#" rel="tooltip" title="first tooltip">
hover over me
</a>
</p>
<p>
<a class="btn"
data-content="And here's some amazing content.
It's very engaging. right?" rel="popover" href="#"
data-original-title="A Title">
Click to toggle popover
</a>
</p>
<p>And then the same in a Modal:</p>
<p>
<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>
</p>
<p class="show-z-index">hover for z-indices:</p>
JavaScript
$('a[rel=tooltip]').tooltip();
$('a[rel=popover]').popover();
// shows element css-classes and z-index of all tooltips, popovers and modals
// only for demonstration
showZIndex = function() {
var zIndices = new Array();
$('div.tooltip, div.popover, div.modal').each( function() {
zIndices.push($(this).attr('class') + '; z-index: ' + $(this).css('z-index'));
});
var html = zIndices.join('<br>');
$('.show-z-index').html(html);
};
$('body').on('hover', 'a[rel=tooltip], a[rel=popover]', showZIndex)
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.