したがって、以下のコードは最初の要素「GALLERYTITLE」に対してのみ機能します。
$(function(){$("#diradd").click(function(event)
{event.preventDefault();$("#diraddform").slideToggle();});});
HTML:
<!--stuff before-->
<div class="gallerytitle"
<a href="#"class="options" id="diradd" >Add new sub-gallery</a> <!--"button"-->
<!--another stuff divs, buttons etc.-->
<div id="diraddform">
<!--things in this div-->
</div></div> <!--the end of #1 gallerytitle div-->
<div class="gallerytitle"
<a href="#"class="options" id="diradd" >Add new sub-gallery</a> <!--"button"-->
<!--another stuff divs, buttons etc.-->
<div id="diraddform">
<!--things in this div-->
</div>
</div> <!--the end of #2 gallerytitle div-->
css:
diraddform{
display:none;}
しかし、.next();は使用できません。「ボタン」の後にdivがあるからです