Toggle any block

$(".js-toggle").on("click", function(event){ var el = $(this).attr("data-toggle"); $(this).toggleClass("is-active"); $("."+el).toggleClass("is-active"); event.stopPropagation(); return false; }); $(".js-toggle-el").on("click", function(event){ event.stopPropagation(); });

2 Responses

This jquery code, not javascript ;).
Can you please give us the complete html code? I dont know how to apply

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.