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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:16:01+00:00 2026-05-14T23:16:01+00:00

I am trying to implement a type of slider using jquery. However this question

  • 0

I am trying to implement a type of slider using jquery. However this question is about the CSS involved in trying to achieve the functionality.

My site design occupies a central column of width 960px. Within this layout there is a central element, that I wish to slide right, on click of a “next” button, and at the same time, another element of the same class slides in from the left to occupy the space vacated. I have drawn a diagram of what I am trying to achieve.alt text http://img714.imageshack.us/img714/692/61886077.png

In this diagram the red blocks are the element I want to slide in and out, it is grouped by a div which moves left to produce the effect using jQuery

I have 2 main questions:

  1. How do I get the correct margin values, given that the browser window width can vary and that all elements that are not the current item should be offscreen?

2.If the user were to resize the margins could be dynamically altered based on the values returned using the jQuery resize() event. Or is there a neater quicker better way of doing it using pure CSS?

  • 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-14T23:16:01+00:00Added an answer on May 14, 2026 at 11:16 pm

    Create a div in the middle, that have margin: auto so that it will always be centered.
    I’m guessing your (red) boxes will always be the same size? Have this centered div with this size, and overflow: hidden. Then inside this div, create the three other divs, which will be moved inside that fixed div size and not the browser window size.

    Something like:

    <body style="text-align: center">
        <div id="container" style="overflow: hidden; width: 960px; height: 600px; margin: auto; position: relative">
         <div id="slider" style="width: 9999px; position: absolute">
          <div id="first" style="width: 960px; float left;"></div>
          <div id="second" ...></div>
          <div id="third" ...></div>
         </div>
        </div>
    </body>
    

    So you move that slider div inside the container setting left: 960px times the number of boxes

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

Sidebar

Related Questions

I'm trying to implement a Tribool type using http://www.boost.org/doc/libs/1_41_0/doc/html/tribool.html as reference. I'm using a
I have a generic class that I'm trying to implement implicit type casting for.
trying to implement a dialog-box style behaviour using a separate div section with all
I have been trying to implement Win32's MessageBox using GTK. The app uses SDL/OpenGL,
I'm trying to implement something like this: <div> <table> <thead> <tr> <td>Port name</td> <td>Current
I am trying to implement Type Hinting of PHP5 on one of my class,
I'm trying to implement a type of SortedMap with extended semantics. I'm trying to
I am using unity as my IoC container. I am trying to implement a
I'm learning Python and i've been trying to implement a Singleton-type class as a
I am trying to implement an UnitOfWork type pattern where one DataContext is used

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.