I have some content that I want to show a paragraph with the class paragraphtoggle when clicked, but it's not working as expected. Here is what I have tried:
HTML
<div class="enzimskiprogramindex herbaprogramindex herbaindex nomargin nopadding container-fluid produkti">
<div class="maincontainer">
<div class="row">
<div class="col-sm-offset-3 col-sm-9">
<div class="col-sm-1">
<img src="img/enzicon.png">
</div>
<div class="col-sm-10">
<h1 class="ffyanone">Enzimski program prihrane pcela</h1>
<p class="paragraphtoggle">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi tempus ultrices nulla,
id consequat ipsum rutrum eget. Sed eget eros sit amet est mattis ultricies vitae ut nibh.
Vestibulum vitae mi tincidunt, dapibus orci nec, malesuada eros. Duis pellentesque tincidunt
quam, et dignissim dolor laoreet sed. In sed turpis ipsum. Integer elementum, orci eu ultrices
facilisis, justo nisi finibus lorem, fringilla pellentesque elit tortor nec sem
</p>
</div>
</div>
</div>
</div>
</div><!--Closed div indexproducts-->
JS
/* Latest compiled and minified JavaScript included as External Resource */ $(document).ready(function () {
$(".enzimskiprogramindex").on('click', function () {
$(".paragraphtoggle").not($(this).next(".paragraphtoggle")).slideUp();
$(this).next(".paragraphtoggle").slideToggle();
});
});