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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:42:35+00:00 2026-06-03T04:42:35+00:00

I am using a div container as a window to slide a list of

  • 0

I am using a div container as a window to slide a list of horizontal li items in and out of view using jquery.

This is what I have so far:
http://jsfiddle.net/TX5fJ/5/

It initializes a list of 8 items and allows you to scroll them left and right within the div window. It also has functions for adding an item to the end of the list and removing an item from the beginning of the list.

What I am trying to do:

1) Add an item to the end of the list (item not visible)

2) Scroll the list to the left to make the item just added visible (first item moves out of view)

3) Remove the item from the head of the list (no longer needed)

The problem is that removing the first item causes the whole list to shift to the left.

If I don’t remove the first item it seems to work. (see my test function)

My concerns with that solution is that the ul will have to be wide enough to hold all the potential items. If I don’t give it a fixed width it does not work.

So i guess I could make it 99999px wide, and use the current method in the test button.

Anyone have a ideas on a better implementation then the current?

Thanks.

  • 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-03T04:42:37+00:00Added an answer on June 3, 2026 at 4:42 am

    You could simply reset the margin-left property of your list after you have removed the list-item from the head:

    function RemoveItem() {
        $('#slider-items li').first().remove();
        $('#slider-items').css('marginLeft', 0);
    }  
    

    Updated fiddle.

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

Sidebar

Related Questions

I have a page ItemList that shows a list of items using div's. After
I am using jQuery to show/hide a div container (#pluginOptionsContainer), and load a page
I have flash resizing it's container div by using external interface to call the
I'm using Javascript/Jquery to have a button toggle which div is displayed in the
I'm trying to create a dialog window using JQuery. I'm making progress so far,
i'm trying to insert an image in a div container using css and html,
So I am creating a container with rounded corners using the following method: div.rounded
I am using JQuery to get the contents of a div, which only contains
I have created one menu using div animating in the middle i have structured.
I'm wondering about http://www.woostercollective.com They have some nice responsive transitions that occurs when window

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.