Jquery展开选定元素旁边的div

Jquery展开选定元素旁边的div,jquery,html,Jquery,Html,我的Html看起来像 <h3><a href="#" title="story title">Story Title</a> <img class="expandstory" src="/images/plus.png" /></h3> <div class="description">Short description about the story</div> 但是没有用。请给我一个解决方案。提前感

我的Html看起来像

<h3><a href="#" title="story title">Story Title</a>
    <img class="expandstory" src="/images/plus.png" /></h3>
<div class="description">Short description about the story</div>
但是没有用。请给我一个解决方案。提前感谢。

试试这个:

$(".expandstory").click(function()  {
     $(".divisionWrap div ul").slideUp(500);
     $(this).parent().nextAll('.description:first').slideToggle(500);
});
另外,建议您不需要使用nextAll()查看逻辑

您只需执行以下操作:

$(this).parent().next('.description').slideToggle(500);
试试这个:

$(".expandstory").click(function()  {
     $(".divisionWrap div ul").slideUp(500);
     $(this).parent().nextAll('.description:first').slideToggle(500);
});
另外,建议您不需要使用nextAll()查看逻辑

您只需执行以下操作:

$(this).parent().next('.description').slideToggle(500);
试一试

试一试

谢谢。成功了$(this).parent()将返回h3标记。我说得对吗?非常感谢。成功了$(this).parent()将返回h3标记。我说得对吗。