我有以下来自jQuery的手风琴脚本,它在Firefox中完美运行但在IE7中没有。在IE7中,我可以看到5个部分,但没有手风琴效果。
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Accordion - Default functionality</title>
<link rel="stylesheet" href="jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"
type="text/javascript"></script>
<script src="jquery-ui.js" type="text/javascript"></script>
<script>
$( function() {
$( "#accordion" ).accordion();
});
</script>
<form id="dialogform" title="Edit User" action="">
<div class="edit">
<div>
<div id="dataEdit">
<div>Name</div>
<input class="name input" type="text" name="name" minlength="2" type="text" required aria-required="true">
<div>Email</div>
<input class="mail input" type="email" name="email" required aria-required="true">
</div>
</div>
</div>
</form>
<form id="dialogNewUser" title="New User" action="">
<div class="edit">
<div>
<div id="dataNew">
<label> Name</label>
<input class="name input" name="name" minlength="2" type="text" required aria-required="true">
<label>Email</label>
<input class="mail input" type="email" name="email" required aria-required="true">
</div>
</div>
</div>
</form>
问题
在IE7中运行此脚本需要做什么?
答案 0 :(得分:0)
IE 7存在错误,您必须设置&#34;动画:false&#34;和&#34; autoHeight:false&#34;解决它。
$(window).load(function() {
$('div.accordion').accordion({
heightStyle: "content",
animated : false,
autoHeight : false
});
});
另外,检查你的锚标签。 IE7并不喜欢它们在dt标签周围。这是一个应该在IE7中运行的JSFiddle,你可以用它作为基础来修复你拥有的东西: