Skip to content Skip to sidebar Skip to footer

Keeping An Uncollapsed Element Open If It's Parent Is Clicked On Again

First of all apologies for the terrible wording, I'm having trouble describing the issue. Currently I have a series of buttons in a horizontal row, whereby clicking on a button sh

Solution 1:

Dont know if this solution will satisfy you but you can block this like that

for example

$('.btn').click(function(e) {
target = $(this).data('target');
if($(target).is(':visible')){
    returnfalse;
}
});

In this situation if you click on "button1" it will collapse the correct div and if you click this again nothing will happen. However clicking another button will collapse another div.

Post a Comment for "Keeping An Uncollapsed Element Open If It's Parent Is Clicked On Again"