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

  • Home
  • SEARCH
  • 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 9154165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:23:12+00:00 2026-06-17T12:23:12+00:00

I have a container div with a ul inside of it setup like this

  • 0

I have a container div with a ul inside of it setup like this jsFiddle: http://jsfiddle.net/BQPVL/1/

Why isn’t the scroll working?

HTML:

<div id="outside">
  <ul id="inside">
    <li>hi</li>
    <li>how are you?</li>
    <li>i am good.</li>
  </ul>
</div>
<button id="left">&larr;</button>
<button id="right">&rarr;</button>

CSS:

#outside {
  width: 200px;
  height: 50px;
  overflow: scroll;
}
#inside {
  width: 1000px;
}
#inside li {
  background: red;
  width: 99px;
  height: 40px;
  border-right: 1px solid black;
  float: left;
  padding: 5px;
}

jQuery:

var position = $("#inside").scrollLeft();
$(document).ready(function() {
  $("#right").bind("click", function() {
    $("#inside").animate({
      scrollLeft: position + 100
    }, 1000);
  });
});
  • 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-17T12:23:13+00:00Added an answer on June 17, 2026 at 12:23 pm

    you need to scrollLeft the element that has the overflow property, and that’s your #outside

    jsBin demo

    $(function() {  // DOM READY shorthand
    
      $("#right, #left").click(function() {
        var dir = this.id=="right" ? '+=' : '-=' ;
        $("#outside").stop().animate({scrollLeft: dir+'100'}, 1000);
      });
    
    });
    

    as you can see you can attach both your buttons to the click handler, and inside it retrieve the clicked button id.
    If this.id returns "right" var dir wil become "+=", otherwise logically
    you clicked the #left one and dir will hold "-="

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

Sidebar

Related Questions

I want to have 3 divs aligned inside a container div, something like this:
Here is my setup: I have a comment container div. Inside this div, I
I have a div[class=container] and inside is div[class=item] like: <style type=text/css> .container{ height:50vh; width:
The idea: I have a container div with two divs inside of it, like
I have a table like this below. And there is a div container with
So I have 3 divs contained inside a containing div like such: <div id=contain>
Ok, I have a label, inside this label is a div, which contains an
I have a container (div) with a background image. In this div there is
If I have a container div called #container which has a bunch of .inside
I have a div container inside which there are several child divs with css

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.