单击 a href 链接时,a href 链接在手风琴内不起作用。似乎手风琴的JS功能覆盖了a href链接。现在点击链接,不是打开另一个页面,而是进出扩展(这是JS的功能),这是JS的原始功能。我想要做的是保持手风琴功能,并使 a href 链接工作。这是示例代码:http: //jsfiddle.net/mrPWa/
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
height = $(window).height();
$('.Accord').css({height: height});
$('.Accord').toggle(function() {
$('.Accord').animate({width: "20%"}, 500 );
$(this).removeClass('deSelect');
$(this).animate({ width: "40%"}, {duration: 500, queue: false});
$('.deSelect').animate({width: "15%"}, {duration: 500, queue: false});
$(this).addClass('deSelect');
}, function() {
$('.deSelect').animate({width: "20%"}, 500);
});
});
a href 链接在这里。
<body>
<div id="Sponsorships_index">
<div id="accordionWrapper">
<ol>
<li id="snow" class="Accord deSelect">
<a href="http://www.apple.com/">
<h1>Apple link is not working!!!!!</h1></a>
</li>
<li id="street" class="Accord deSelect">
<a href="http://www.apple.com/">
<h1>Apple link is not working!!!!!</h1></a>
</li>
<li id="water" class="Accord deSelect">
</li>
<li id="dirt" class="Accord deSelect">
</li>
<li id="sound" class="Accord deSelect">
</li>
</ol>
</div>
</div>
</body>