open closest container div with jquery -
i have question. have html. in readmore box, there lot of content. , how more .readmore-open links , readmore boxes on web page.
<p> <a href="http://staging.triple-b-it.nl/requirements-management/" title="lees verder" class="readmore-open">lees verder</a> </p> <div class="readmore-box"> </div>
now question. when click .readmore-open link. first readmore-box coming, must show. have script. doing wrong.
$('.readmore-open').click(function(e){ $(this).closest('.readmore-box').toggleclass('active'); })
$('.readmore-open').click(function(){ $(this).closest('p').next('.readmore-box').toggleclass('active'); });
your dom traversal bit off.
Comments
Post a Comment