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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:18:21+00:00 2026-05-14T02:18:21+00:00

Here’s a scenario… I have a column. In the column i have multiple divs

  • 0

Here’s a scenario…

I have a column. In the column i have multiple divs with text inside each one. A bit like a list of categories. Which ever one is SELECTED gains a different background colour.

What i would like to be able to do is use jquery so that when a different div is clicked on the background colour appears to slide behind the rest of the items until it reaches the one you selected.

Does anyone have any idea if this can be done? And if so any idea on Markup?

Any help is greatly appreciated.

There would be need to be a wrapper, a content container for each part and something that slides…

<div>
  <div class='slider'></div>
  <div>Content 1</div>
  <div>Content 2</div>
</div>
  • 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-14T02:18:21+00:00Added an answer on May 14, 2026 at 2:18 am

    Interesting request 🙂 You can do this with .animate() and a little bit of CSS, like this:

    <html>
     <head>
       <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
       <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript"></script>
       <script type="text/javascript">
       </script>
       <style type="text/css" >
        #content div { width: 200px; z-index: 2; }
        #content div.slider { position: absolute; background: #99AABB; z-index: -1; }
       </style>
     </head>
     <body>
    <script language="javascript" type="text/javascript">
    $(function(){
      $("#content div:not(.slider)").click(function() {
       $(".slider").animate({ top: $(this).offset().top, height: $(this).height() });
      });
    });
    </script>
      <div id="content">
        <div class='slider'></div>
        <div>Content 1 Test<br/>Test<br/>Test<br/>Test<br/>Test<br/>Test</div>
        <div>Content 2<br/>Test<br/>Test<br/>Test<br/>Test<br/>Test<br/>Test</div>
      </div>
     </body>
    </html>
    

    Try it out 🙂 Just click on either div to see the effect. See a demo here

    The important bits:

    • Ignore the .slider div in the click handler
    • .animate() to same offset/height as destination div
    • Lower z-index so it shows up as the background
    • You could use an image, whatever’s in the CSS for the .slider div will work
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the Javascript I currently have <script type=text/javascript> $(function() { $('.slideshow').hover( function() {
Here's my scenario - I have an SSIS job that depends on another prior
here is code: <script type=text/javascript> function doit(){ $('table td').each(function () { if ($(this).text().trim() !=
Here i need to attach one image with mail, the passing image like this
Here is the script I'm using, copied directly from Google: <script type=text/javascript> var _gaq
Here is the scenario. I'm writing my geo-ruby oracle adapter for Ruby On Rails
Here's the basic setup: I have a thin bar at the top of a
Here is my problem : I have a post controller with the action create.
Here is an example: I write html code inside of textarea, then I swap
Here is an example: I have the generic type called Account. I wish to

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.