当我删除手风琴的一部分时,我试图让动画工作。而不是消失,我希望它做一些超级酷的事情。在这种情况下如何让动画工作?谢谢一堆。这是我的 JS:
$('document').ready(function(){
$('#accordion .red').click(function(){
$(this).parent('div').prev( 'h3' ).remove();
$(this).parent('div').remove();
$(this).parent('div').prev('div').animate("bounceslide");
return false;
});
});
这是我的 HTML:
<div id="accordion">
<h3><a href="#">Section 1</a></h3>
<div class="squares">
<a href="#" class="green">1</a>
<a href="# "class="red">2</a>
<a href="#" class="blue">3</a>
<p>
Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit
amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut
odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
</p>
</div>
<h3><a href="#">Section 1</a></h3>
<div class="squares">
<a href="#" class="green">1</a>
<a href="# "class="red">2</a>
<a href="#" class="blue">3</a>
<p>
Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit
amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut
odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
</p>
</div>
</div>