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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:09:57+00:00 2026-05-27T18:09:57+00:00

I am creating a site with a jQuery gallery, and I have the gallery

  • 0

I am creating a site with a jQuery gallery, and I have the gallery (similar to lightbox) working well.
My question is, can I create a CSS “body class” that I could call from a jQuery event?
This is what I want:
When someone clicks on the image, the gallery appears. Then the body background becomes black, and shrinks to the size of the browser page, and the mainContent disappears only showing the image.
Is there any way to add a body class to the page when a event occurs? Like:

 $("div_one").click(function(){
   $("body").addClass("the_new_body_css_look"); 
 });

And the CSS:

.the_new_body_css_look {

     body { 
       /* the colors */
     }
     mainContent {
       /* the size */
     }
}
  • 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-27T18:09:58+00:00Added an answer on May 27, 2026 at 6:09 pm

    Probably the fastest way to check it would be to try it yourself. The answer is yes you can.

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

Sidebar

Related Questions

Creating a site in with FrogCMS and using alot of jquery to create an
Question about creating pages in jQuery Mobile. I've created a mobile site... if you
I'm new to JQuery and I'm creating a site where one can click on
I am creating site with php. On localhost all works well. On my hosting
I am creating a site and want to have individual pages for each row
I am creating a site that requires a very small postcode checker. I have
Right, last question for a while! I am creating a horizontal portfolio site and
currently I have the a basic jQuery gallery: <ul> <li>IMAGE</li> <li>IMAGE</li> </ul> // with
I'm creating a site where users can bid on items in a silent auction.
I have my site built with jquery show/hide divs and want to have a

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.