我遇到了和上周一样的麻烦。
我的 html 代码如下所示:
<article class="tickets">
<div class="grid_12 left">
<div class="header">
<i class="icon-pushpin"></i>
Neue Tickets
<div class="count right"><span>6</span></div>
</div>
<div class="messages">
<div class="msg">
<div class="dreieck prio_a"></div>
<div class="ava right"><img src="http://lorempixel.com/40/40/" alt="Test"></div>
<div class="autor">Lars</div>
<small class="subject">Test</small>
</div>
<div class="msg">
<div class="dreieck prio_a"></div>
<div class="ava right"><img src="http://lorempixel.com/40/40/" alt="Test"></div>
<div class="autor">Lars</div>
<small class="subject">Test</small>
</div>
<div class="msg">
<div class="dreieck prio_a"></div>
<div class="ava right"><img src="http://lorempixel.com/40/40/" alt="Test"></div>
<div class="autor">Lars</div>
<small class="subject">Test</small>
</div>
<div class="msg">
<div class="dreieck prio_a"></div>
<div class="ava right"><img src="http://lorempixel.com/40/40/" alt="Test"></div>
<div class="autor">Lars</div>
<small class="subject">Test</small>
</div>
<div class="msg">
<div class="dreieck prio_a"></div>
<div class="ava right"><img src="http://lorempixel.com/40/40/" alt="Test"></div>
<div class="autor">Lars</div>
<small class="subject">Test</small>
</div>
<div class="msg">
<div class="dreieck prio_a"></div>
<div class="ava right"><img src="http://lorempixel.com/40/40/" alt="Test"></div>
<div class="autor">Lars</div>
<small class="subject">Test</small>
</div>
</div>
<div class="header">
<i class="icon-pushpin"></i>
Neue Tickets
<div class="count right"><span>6</span></div>
</div>
<div class="messages">
<div class="msg">
<div class="dreieck prio_a"></div>
<div class="ava right"><img src="http://lorempixel.com/40/40/" alt="Test"></div>
<div class="autor">Lars</div>
<small class="subject">Test</small>
</div>
<div class="msg">
<div class="dreieck prio_a"></div>
<div class="ava right"><img src="http://lorempixel.com/40/40/" alt="Test"></div>
<div class="autor">Lars</div>
<small class="subject">Test</small>
</div>
<div class="msg">
<div class="dreieck prio_a"></div>
<div class="ava right"><img src="http://lorempixel.com/40/40/" alt="Test"></div>
<div class="autor">Lars</div>
<small class="subject">Test</small>
</div>
<div class="msg">
<div class="dreieck prio_a"></div>
<div class="ava right"><img src="http://lorempixel.com/40/40/" alt="Test"></div>
<div class="autor">Lars</div>
<small class="subject">Test</small>
</div>
<div class="msg">
<div class="dreieck prio_a"></div>
<div class="ava right"><img src="http://lorempixel.com/40/40/" alt="Test"></div>
<div class="autor">Lars</div>
<small class="subject">Test</small>
</div>
<div class="msg">
<div class="dreieck prio_a"></div>
<div class="ava right"><img src="http://lorempixel.com/40/40/" alt="Test"></div>
<div class="autor">Lars</div>
<small class="subject">Test</small>
</div>
</div>
</div>
</article>
和 jQuery 部分:
$('.header').click(function(e) {
$(this).siblings('.messages').slideDown(500);
$(this).next().slideUp('normal');
e.preventDefault();
});
第一个菜单幻灯片向下和向上,第二个菜单向下。我会在第一个菜单上滑下,然后单击“标题”后上滑。当第一个菜单打开并且您单击第二个菜单时,第一个菜单应该向上滑动,第二个向下滑动。我的代码有什么问题?