Hi there, I'm attempting to achieve a similar effect as the hover action in my first fiddle. I'd like to use jQuery click/toggle to expand the content instead of displaying it on hover.
I've been working with basic addClass using jQuery/CSS, but for some reason, it's not functioning properly and I can't seem to figure out how to fix it.
I would greatly appreciate any help or advice on this matter. Thank you very much in advance.
Here is the fiddle that I've created with the jQuery I am currently using.
$(document).ready(function(){
$(".gamewrapper").click(function(){
$(".gamewrapper").addClass("expand");
});
});
I have experimented with toggleClass and managed to make it work somewhat, but it's still only displaying the second content on both captures. Here is the updated code in this new fiddle.
$(document).ready(function(){
$(".gamewrapper").click(function(){
$(".game-name").toggleClass("black");
$(".gamewrapper").toggleClass("expand");
});
});
Thank you.