Skip to content

Instantly share code, notes, and snippets.

@kylebuch8
Created August 29, 2013 14:07
Show Gist options
  • Save kylebuch8/6378528 to your computer and use it in GitHub Desktop.
Save kylebuch8/6378528 to your computer and use it in GitHub Desktop.
/*
* ========================================================================
* Initialize the Popovers!!!
* ========================================================================
*
* there is an issue with IE7 and IE8 creating popovers
* in the way that i want to create them. lucky for us,
* there is a fix. make sure that we only apply the fix
* for IE7 and IE8
*
* https://github.com/twbs/bootstrap/issues/7193
*/
if (!$('html').hasClass('lt-ie9')) {
$('body').popover({
selector: 'a[data-toggle=popover]',
trigger: Modernizr.touch ? 'click' : 'hover'
});
} else {
$('.lt-ie9 body').on('mouseenter', 'a[data-toggle=popover]', function() {
$(this).popover({
container: 'body',
trigger: 'manual'
}).popover('show');
});
$('.lt-ie9 body').on('mouseleave', 'a[data-toggle=popover]', function() {
$(this).popover('hide');
});
}
$('body').on('click', 'a[data-toggle=popover]', function(event) {
event.preventDefault();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment