forum

Home / DeveloperSection / Forums / Jquery Toggle If statement

Jquery Toggle If statement

Anonymous User 2276 23-Nov-2014

I'm trying to run a function when the state of the toggle is only "open". Right now the function runs either way. I'm not entirely sure how to make it so that it only runs when the toggle is opened. I found the toggle code somewhere and used it, it works great.

$( "#SB2p" ).click(function() {
        $( "#SB2").toggle('slow',function(){
            var $link =$("#SB2p");
            $(this).is(":visible") ? $link.text("<<<") : $link.text(">>>");
        });
        accumulative();
    });

Any help would be great.


Updated on 24-Nov-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By