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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:53:23+00:00 2026-06-18T22:53:23+00:00

I feel sure this should already be covered here, but I haven’t been able

  • 0

I feel sure this should already be covered here, but I haven’t been able to track down a question that specifically deals with this.

I have 2 divs within a page, like this…

<div class="span4 section">
    ...content...
</div>
<div class="span8 section">
...content...
</div>

I need to implement an onclick that will hide the span4 div and change the class of the span8 div to span12, and after that has been done be able to revert it back (using jQuery.toggle, I assume).

I can successfully do one or the other, but can’t get both things to work at the same time using my somewhat limited JS/jQuery knowledge!

  • 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-18T22:53:23+00:00Added an answer on June 18, 2026 at 10:53 pm

    you should add another class name to you span8 class, e.g. toggleSpan and then

    $('.clickElement').click(function () {
      $('.span4').toggle(); // this toggles only visibility
      $('.toggleSpan').toggleClass('span8 span12');
    });
    

    assuming that the element you want to use as trigger has the class clickElement

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

Sidebar

Related Questions

I'm fairly sure this has a simple solution, but I haven't been able to
I'm pretty sure it hasn't, but apologies if this question has already been asked.
Feel free to close and/or redirect if this has been asked, but here's my
I'm sure this question has been asked but it's hard to just google specifically
I'm pretty sure that this is the right site for this question, but feel
Sorry if this has already been asked, but I just want to make sure
I feel embarrassed to ask this question as I feel like I should already
I feel like there's a simple solution to this, but I'm not really sure
This is probably a noob question that I will get slated for but here
I feel like this should be trivial, but I've struggled to find anything useful

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.