Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7854465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:04:13+00:00 2026-06-02T20:04:13+00:00

I have following jquery code plugin: (function ($) { $.fn.extend({ collapsiblePanel: function () {

  • 0

I have following jquery code plugin:

           (function ($) {
                $.fn.extend({
                    collapsiblePanel: function () {
                        // Call the ConfigureCollapsiblePanel function for the selected element
                        return $(this).each(ConfigureCollapsiblePanel);
                    }
                });
            })(jQuery);

            function ConfigureCollapsiblePanel() {
                $(this).addClass("ui-widget");

                // Check if there are any child elements, if not then wrap the inner text within a new div.
                if ($(this).children().length == 0) {
                    $(this).wrapInner("<div></div>");
                }

                // Wrap the contents of the container within a new div.
                $(this).children().wrapAll("<div class='collapsibleContainerContent ui-widget-content'></div>");

                // Create a new div as the first item within the container.  Put the title of the panel in here.
                $("<div class='collapsibleContainerTitle ui-widget-header'><div>" + $(this).attr("title") + "</div></div>").prependTo($(this));


                // Assign a call to CollapsibleContainerTitleOnClick for the click event of the new title div.
                $(".collapsibleContainerTitle", this).click(CollapsibleContainerTitleOnClick);
            }


            function CollapsibleContainerTitleOnClick() {
                // The item clicked is the title div... get this parent (the overall container) 
                // and toggle the content within it.
                $(".collapsibleContainerContent", $(this).parent()).slideToggle();
            }

Then here is the html:

<div class="collapsibleContainer" title="Example Collapsible Panel">
                                    <p>
                                        KDLorem ipsum dolor sit amet, consectetur adipiscing elit.... (you get the idea!)
                                    </p>
                                </div>  

Then here is the css:

.collapsibleContainer
{
}

.collapsibleContainerTitle
{
   cursor:pointer;
}

.collapsibleContainerTitle div
{
  padding-top:5px;
  padding-left:10px;
}

.collapsibleContainerContent
{
   padding: 10px;
}

Here is the document ready function:

jQuery(function () {
   jQuery(".collapsibleContainer").collapsiblePanel();
});

What do I need to write to make the Panel actually collapse on document ready instead of expand as it is now doing when the document is loaded?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:04:15+00:00Added an answer on June 2, 2026 at 8:04 pm

    Set the content of your panel to display:none.

    Looks like the plugin uses slideToggle(), which just animates transition to/from display:none.

    So, I think this:

    .collapsibleContainerContent
    {
       padding: 10px;
       display: none;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following jquery code: jQuery(function(){ jQuery(select#rooms).change(function(){ var options = ''; jQuery.getJSON(/admin/selection.php,{id: jQuery(this).val(),
Say I have the following jQuery plugin: $.fn.myPlugin = function () { //plugin code
I am using jQuery Address Plugin and I have the following code. $.address.change(function(e) {
I have a following code: $(document).ready(function() { $('a[rel]').each(function() { $(this).qtip( { content: { text:
I'm currently using this jQuery Cycle Plugin: http://jquery.malsup.com/cycle/ And I have the following code:
I have the following code to utilize the jquery FullCalendar plugin: $(function () {
I have the following JQuery code that worked perfect in C#/Asp.net 2.0 to call
I have the following JQuery code: <script type=text/javascript> $(document).ready(function () { var $containerHeight =
I have the following JQuery code: $(document).ready(function () { var $containerHeight = $(window).height(); if
I have the following code for the jQuery validation plugin.... basically on submit, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.