Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can i init close the panel x_panel for default? #917

Open
residente007 opened this issue Nov 26, 2020 · 2 comments
Open

can i init close the panel x_panel for default? #917

residente007 opened this issue Nov 26, 2020 · 2 comments

Comments

@residente007
Copy link

residente007 commented Nov 26, 2020

can i init close the panel x_panel for default?

I mean. Keep closed when load or reload or refresh the page

How can i do it?

I have the HTML template

@NevilleDoke
Copy link

Hii @residente007 you can add the below script to initially close the x_panel.

<script> $(document).ready(function() { // Store the content of .x_content elements before removing them $(".x_panel").each(function() { var content = $(this).find(".x_content").detach(); $(this).data("content", content); }); $(".collapse-link").on("click", function() { var panel = $(this).closest(".x_panel"), icon = $(this).find("i"), content = panel.find(".x_content"); if (content.length === 0) { // If .x_content does not exist, add it back content = panel.data("content"); panel.append(content); content.hide(); // Hide the content initially to prepare for the slide toggle } // Toggle the .x_content visibility content.stop(true, true).slideToggle(200, function() { if (!panel.attr("style")) { panel.css("height", "auto"); } else { panel.removeAttr("style"); } }); // Toggle the icon class icon.toggleClass("fa-chevron-down fa-chevron-up"); }); $(".close-link").click(function() { $(this).closest(".x_panel").remove(); }); }); </script>

@NevilleDoke
Copy link

Hii @puikinsh please close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants