JSFiddle - React, Tailwind, and code Playground
by doug65536
JavaScript
$(function () {
function initActionDropDown() {
$(".dropdown .has-dropdown").click(function () {
if (!$(this).find("span.toggle").hasClass("active")) {
$(".dropdown-slider").slideUp();
$("span.toggle").removeClass("active");
}
$(this).parent().find(".dropdown-slider").slideToggle("fast");
$(this).find("span.toggle").toggleClass("active");
return false;
});
}
$(document).bind("click", function (a) {
if (a.target.id != $(".dropdown").attr("class")) {
$(".dropdown-slider").slideUp();
$("span.toggle").removeClass("active");
}
});
});