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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:30:03+00:00 2026-05-20T23:30:03+00:00

I have just finished incorporating a jQuery accordian with a jQuery Slider. I.e. 3

  • 0

I have just finished incorporating a jQuery accordian with a jQuery Slider.
I.e.

3 pictures are displayed. The user can either use PREV or NEXT buttons to view the next/prev 3 images. They can also navigate through all the images with the slider.

The next step is to make this slider look like a timeline. The left hand side needs to start at 1970 and finish at 2010. For each item (an item is a set of 3 images in this case) I need it to show a date on the timeline.

i.e: alt text

I know I could create an image with the dates the right width apart but idealy this needs to be dynamic so more items can be put in and the timeline self updates.

  • 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-20T23:30:04+00:00Added an answer on May 20, 2026 at 11:30 pm

    At a high level, the following should work:

    1. Get the total width of the slider UI element, in pixels.
    2. Divide this number by [total number of labels] - 1 to get the total number of pixels to allocate to each label.
    3. Add a series of div’s immediately after the slider div with the width you got in step 2 and the float:left style.
    4. Follow everything with an empty div with the clear: both style.

    Here is a basic example:

    CSS

    .timeline {
        width: 500px;
        border: 1px solid black;
    }
    .timelineEntry {
        float: left;
    }
    .first {
        position: relative; left: 5px;
    }
    .last {
        position: relative; left: -10px;
    }
    .clear {
        clear: both;
    }
    

    Markup

    <div id="timelineContainer">
        <div class="timeline" id="slider">
            Slider UI Goes Here
        </div>
    </div>
    <div class="clear"></div>
    

    JavaScript

    var container = document.getElementById("timelineContainer");
    var labels = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"];
    var totalWidth = $("#slider").width();
    var labelWidth = Math.floor(totalWidth / (labels.length - 1));
    for (var index = 0; index < labels.length; index++) {
        var nextLabel = document.createElement("div");
        nextLabel.className = "timelineEntry";
        if (index == 0) {
            nextLabel.className += " first";
        }
        else if (index == labels.length - 1) {
            nextLabel.className += " last";
        }
        nextLabel.style.width = labelWidth + "px";
        nextLabel.innerHTML = labels[index];
        container.appendChild(nextLabel);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just finished creating an API where the requests from the API are
I have just finished ridding my project of leaks, but there are still thousands
I have just finished creating an entire login and register systsem in PHP, but
All, I have a basic Windows 7 Phone application and I have just finished
I just finished reading the HTML5 Developer's Cookbook and have a question. I've read
I've just finished merging two branches that have been separated for a long time,
I have just started using android, and have about 5 layout files finished. However,
I've just finished my Android widget. Now I need to have different sizes of
I have something weird going on here. I just finished a site for a
i have just finished my first app and would like to incorporate ad 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.