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 7891415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:36:48+00:00 2026-06-03T06:36:48+00:00

My page has six div elements. Using jQuery and Z-Index, clicking on a button

  • 0

My page has six div elements.

Using jQuery and Z-Index, clicking on a button increases the width of one div to cover all the others. In the process, it also assumes the class: active (z-index:900).

When I click another button, the div with the class active should return to its original size and position. The original values are saved into variables, but how can I know the name of the element with the active class?

  • 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-03T06:36:49+00:00Added an answer on June 3, 2026 at 6:36 am

    This is one of the fundamental features of the jQuery function aka $().

    Doing this:

    var elements = $(".myclass");
    

    will give you all of the elements that are using CSS class myclass. From there you can do this:

    elements.css({
        left: orig_left,
        top: orig_top,
        width: orig_width,
        height: orig_height
    });
    

    The style changes will apply to all of the elements at once.

    However if you wish to restore an element to its defaults (ie what was in the original html), you can do this:

    elements.css({
        left: null,
        top: null,
        width: null,
        height: null
    });
    

    or even:

    elements.attr("style","");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my Page has many hover images, sometimes there are backgrounds from div-elements or src
I am using js/jquery to create draggable graph. Graph has two draggable elements that
A page has a list of articles. Clicking "more" button, more articles will be
Since I use jQuery 1.3+ all except one timed test is using that. The
I'm trying to make a WordPress site that has six lists on a page,
I have a page which has an Iframe. In that Iframe, there are six
I have a page with six ifrmaes inside it. Each frame has individual id,
Page has menu items that would replace a 'div id=foo_(current menu item)' with 'div
The page has a container div which holds multiple content divs. Each content div
My page has about 25 radio button groups. When a radio button is selected

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.