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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:22:19+00:00 2026-05-28T08:22:19+00:00

I have the following code that seems to scroll a div on click all

  • 0

I have the following code that seems to scroll a div on click all the way to the left. I am wondering if:

  1. there is a way to get it to get it to scroll only 200px at a time.
  2. I can get it to scroll to the right as well. Tried to look at the jQuery documentations but could not find a scrollToRight function.

Here is my code:

$(".leftArrow").click(function () { 
  $(".innerWrapper").animate({scrollLeft: 250}, 800);
});
.innerWrapper
{
	float: left;
	margin-right:-32767px;
}
.outerWrapper
{
	width: 780px;
	height: 180px;
	overflow: hidden;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<input type='button' class='leftArrow' value='left'>
<input type='button' class='rightArrow' value='right'>

<div class='outerWrapper'>
   <div class='innerWrapper'>
         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
   </div>
</div>

Any help would be greatly appreciated.

  • 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-28T08:22:20+00:00Added an answer on May 28, 2026 at 8:22 am

    scrollLeft IS scrollRight. Sort of. All it does is set the amount of horizontal scroll. If you set it to zero then it will be all the way left. If you set it to something greater than zero then it will move to the right!

    As far as making it go in increments, you would have to get the current scrollLeft distance and then subtract 200.

    $(".leftArrow").click(function () { 
      var leftPos = $('.innerWrapper').scrollLeft();
      $(".innerWrapper").animate({scrollLeft: leftPos - 200}, 800);
    });
    
    $(".rightArrow").click(function () { 
      var leftPos = $('.innerWrapper').scrollLeft();
      $(".innerWrapper").animate({scrollLeft: leftPos + 200}, 800);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code that won't compile and although there is a way
I have the following code and the only redirect that seems to be working
I have the following code that seems like it should set my insertParameter but
I have following code that does not work due to a being a value
I have following code snippet that i use to compile class at the run
I have the following code that shows either a bug or a misunderstanding on
I have the following code that sets a cookie: string locale = ((DropDownList)this.LoginUser.FindControl(locale)).SelectedValue; HttpCookie
I have the following code that creates two objects (ProfileManager and EmployerManager) where the
I have the following code that I need to add an additonal object to
I have the following code that creates a serverside object of the xmlhttp class.

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.