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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:06:59+00:00 2026-05-21T05:06:59+00:00

I have divs on my page as below: <div id="switch"> <div id="b1"></div> <div id="b2"></div>

  • 0

I have divs on my page as below:

<div id="switch">
<div id="b1"></div>
<div id="b2"></div>
<div id="b3"></div>
</div>

with styling as:

#switch{
    background-position: 0px 0px;
    width: 300px;
    height: 100px;
    background-image: url(test.png);
    background-repeat: no-repeat;
}
#b1{
  width: 100px;
  height: 100px;
}
#b2{
  width: 100px;
  height: 100px;
  margin-left: 100px;
  margin-top: -100px;
}
#b3{
  width: 100px;
  height: 100px;
  margin-left: 200px;
  margin-top: -100px;
}

I want to change background-position to background-position: 0px -100px;, background-position: 0px -200px; and background-position: 0px -300px; when user hover on b1, b2, and b3 respectively.

You can see my fiddle here.

How can I make this possible?

  • 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-21T05:07:00+00:00Added an answer on May 21, 2026 at 5:07 am
    var $switch = $('#switch');
    $('#b1').hover(function() {
        $switch.css({
            backgroundPosition: '0px -100px'
        })
    }, function() {
        $switch.css({
            backgroundPosition: '0 0'
        })
    }
    )
    

    This is done for #b1, you can do the same for others.

    Check working example at http://jsfiddle.net/MFJDE/3/

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

Sidebar

Related Questions

So.. I have a dynamic width page. Below, the wrapper div centers the divs
So.. I have a dynamic width page. Below, the wrapper div centers the divs
I have a page with 7 divs as below; <div id=container> <div id=head></div> <div
I have a page with a couple of divs, sort of like this: <div
I have a page with the following two divs: <div id=searchResults> </div> <div class=postSearchOptions
I have a header div, fixed position at the top of the page. Inside
I have a container div which is centred at 50% of the page width.
I have three divs page-left page-right flipper I have images of equal size in
I have five divs on my page (#art #fashion, #self, #nightlife, #community). right now,
I have three Divs on the page and they are absolute positioned. Lets call

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.