To have anchor links inside a Bootstrap popover work on IE 8
Internet Explorer 8 seems to do absolutely nothing when these links are clicked inside the popover.
Other browser I have tested (Latest Chrome, Latest Firefox) work fine.
Hovering over the link does change the Status toolbar...
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
<body>
<p>Hello, <a href="#" class="pop" tabindex="0" data-title="<b>Search Engines</b>" data-content='• <a href="http://google.co.uk" target="_NEW">Google</a><br>• <a href="http://bing.co.uk" target="_NEW">Bing</a><br>• <a href="http://yahoo.co.uk" target="_NEW">Yahoo</a>'>visit & search here</a></p>
<script>
var options = {
placement: "bottom",
html: true,
trigger: "focus",
toggle: "popover"
};
$(".pop").popover(options).click(function(e) {
e.preventDefault();
});
</script>
</body>
</html>
I changed the trigger from focus
to click
and the issue was resolved on IE 8 and continued to work on other tested browsers.
Changing this caused the auto hide to stop working so I amended the js function...
$(".poper").popover(options).click(function(e){
e.preventDefault();
$('.poper').not(this).popover('hide'); // here is the new bit
});