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

  • SEARCH
  • Home
  • 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 6083393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:23:55+00:00 2026-05-23T11:23:55+00:00

I have an admin page with an accordion javascript to show/hide divs. <div class=accordion>

  • 0

I have an admin page with an accordion javascript to show/hide divs.

<div class="accordion">
    <h2>Pending</h2>
    <div id="pending" class="accordion-item">PARTIALVIEW</div>
    <h2>Current</h2>
    <div id="current" class="accordion-item">PARTIALVIEW</div>
    <h2>All</h2>
    <div id="all" class="accordion-item">PARTIALVIEW</div>
</div>

when they delete an item, the page refreshes and they are back to collapsed. I want to have it remember which ones were open and which ones were closed.

the accordion javascript gives the div style="display: none" or style="display: block"

is there a way to get what the style is before the page is reloaded and apply it after it is loaded again?

  • 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-05-23T11:23:55+00:00Added an answer on May 23, 2026 at 11:23 am

    If you want to see the styles and changes actively on the page I recommend using Firebug (a FireFox plugin).

    As for saving the state, there are two approaches. The first is an AJAX approach. The second a JS only, cookie-based approach.

    For the AJAX method you need to write a JS function that fires off whenever the state is changed. This method then sends the state of all of the collapsible options to the server in a quick behind-the-scenes query. The server then saves this information to a session variable. Then when the page is reloaded the server can plant a JS array with the last known state information for each item on the page.

    For the second method you must set a cookie that holds a variable with the state of all of the items. This can be a simple array. This works the same as the AJAX method except that the data is saved on the client-side browser instead of the server. You get the state from the cookie array instead of the server array.

    For either one of these I would recommend using the JQuery library. For the cookie method I would recommend using the Cookie plugin for JQuery (http://plugins.jquery.com/project/Cookie). Here is a quick howto article about this: http://jquery-howto.blogspot.com/2010/09/jquery-cookies-getsetdelete-plugin.html

    JQuery – http://jquery.com/
    JQuery UI – http://jqueryui.com/
    Visual JQuery (a great, easy to use reference for JQuery) – http://visualjquery.com/
    Firebug – http://getfirebug.com/
    Firefox – (never leave home without it) http://www.mozilla.com/en-US/firefox/fx/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an admin page for a store where a user can modify item
I have this model I'm showing in the admin page: class Dog(models.Model): bark_volume =
Hey guys I have an admin page that checks if you are admin before
Okay, my dilemma is this. I have an admin page that I use to
I have written a ruby script which opens up dlink admin page in firefox
I have a path defined: when /the admin home\s?page/ /admin/ I have scenario that
My project is about a school admin I have a page called : createClass.php,
I have a page which basically allows an admin user to create manager user
I have a web page, used for admin purposes, which runs a task (image
I have a URL like /admin/editblogentry?page=3&color=blue I want to alter the 'page' in the

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.