手风琴不适用于 IE8



以下HTML适用于Firefox和Google Chrome。但是,它不适用于Internet Explorer 8。面板不会展开(请参阅下面的代码(。

无论如何,我可以让它与IE8一起使用吗?

<!DOCTYPE html>
<html>
<head>
<title>
Test
</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src=" http://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
.custom {
width: 130px !important;
}
div.panel {
display: inline-block;
background-color: lightblue;
}
</style>
</head>
<body>
<div class="accordion" id="myAccordion">
<div class="panel">
<button type="button" class="btn btn-primary custom" data-toggle="collapse" data-target="#collapsible-1" data-parent="#myAccordion">Section 1</button>
<div id="collapsible-1" class="collapse">
Content
</div>
</div>
<br/>
<div class="panel">
<button type="button" class="btn btn-primary custom" data-toggle="collapse" data-target="#collapsible-2" data-parent="#myAccordion">Section 2</button>
<div id="collapsible-2" class="collapse">
Content
</div>
</div>
<br/>
</div>
</body>
</html>

事实上,你这样做的方式不是在IE上工作的。我直接从 jqueryui 测试了代码,你可以在这里找到它,它对我有用。 您也可以尝试更改与<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />的兼容性并尝试不同的版本,但我认为这不是最好的方法。

最新更新