Hiding and showing a div

Status
Not open for further replies.

Genaga

New Member
Mar 12, 2015
29
8
Sup guys!

Having a little problem here with HTML and JQuery

So I have this code in a @foreach
HTML:
<div class="activity-buttons">
                            <button style="margin-top:25px;" class="comment button button-ghost">Comment</button>
                        </div>
<div class="CommentForm" style="display:none;">
---form shit--
</div>

In my JQuery I have this
$( ".comment" ).click(function() {
$(this).next(".CommentForm").slideToggle( "fast", function() {
});
});
based from this


The .js file is definitely being loading, but it is simply not working, when I press the button, nothing happens.

I feel like its going to be something small and stupid and I'll feel like an idiot but ah well.

If you need any more info let me know!
 

Genaga

New Member
Mar 12, 2015
29
8
Thanks Teso, got it working based off that, was just about to post that it doesn't work because I actually read what .next() does properly.
I had a similar problem once that did it in a similar way but couldn't find anything on the web or on my old project.

Thank you kindly!
 
Status
Not open for further replies.

Users who are viewing this thread

Top