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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:57:16+00:00 2026-06-12T12:57:16+00:00

Basically I’m working with a piece of jQuery that I’m using to control an

  • 0

Basically I’m working with a piece of jQuery that I’m using to control an image fade.

This piece of code, first identifies a div class of .fade, then connects a .hover to it.

When .fade is hovered over, an image within a display:none div within the .fade class is slowly faded in bringing opacity back to 1.

It’s a fairly simple piece of code, but I’m wondering if there’s a way to modify it in order to work with multiple classes (ie. fadetwo, fadethree, etc)… because it works off of a div within the parent .fade class it should work right?

I just can’t seem to make it work. I’m trying to add additional classes in this line:

$('div.fade').hover(function()

Like:

$('div.fade, div.fadetwo, div.fadethree').hover(function()

I’m just trying to make so I can have multiple divs (.fade, .fadetwo, etc.) have that same hover effect (obviously each with different images)… I’m not sure if jQuery even works like this.

Possibly there is a better way to do this?… Beneath is my code.

http://jsfiddle.net/yvgFy/

  • 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-12T12:57:17+00:00Added an answer on June 12, 2026 at 12:57 pm

    It’s not clear whether you want to select with ALL three classes or with ONE of the three classes. Therefore I explain both possibilites:

    Select ALL classes

    Write your classes together without spaces and commas, like this:

    $('div.fade.fadetwo.fadethree')
    

    this selects only divs with all three classes.

    Select ONE of the classes

    If you need to select divs with one of the three classes, omit the spaces, like this:

    $('div.fade,div.fadetwo,div.fadethree')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I've made a form in Cakephp 2.1 with a jQuery button that appends
Basically this function is meant to store the height value of the element that
basically I have a function that resizes elements accordingly with jquery triggering the function
Basically I have some simple code that does some things for files and I'm
Basically from a database I am getting data that is formatted like this nameofproject101
Basically, I have code where the user clicks a link, and then a div
Basically, something better than this: <input type=file name=myfile size=50> First of all, the browse
Basically I'm wondering if I can compile code that a user inputs in a
Basically I have a main screen that comes up with a background image and
Basically, I have a UIImageView that will loop through 8 PNGs over 0.5 seconds.

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.