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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:27:32+00:00 2026-05-23T22:27:32+00:00

i have a slider that scrolls on drag using the jquery UI however the

  • 0

i have a slider that scrolls on drag using the jquery UI however the handle seems to drag slightly to far off the end of the slide bar can anyoune see why this might be?

HTML

    <div id="content">

<div id="sliderContent">    
      <div class="viewer">
        <div class="content-conveyor ui-helper-clearfix">

          <div class="item">

          <img src="images/slide_image_one.png"/>

          </div>

          <div class="item">

          <img src="images/slide_image_one.png"/>

          </div>

          <div class="item">

          <img src="images/slide_image_one.png"/>

          </div>

          <div class="item">

          <img src="images/slide_image_one.png"/>

          </div>

          <div class="item">

          <img src="images/slide_image_one.png"/>

          </div>

        </div>
      </div>
      <div id="slider"></div>
    </div>

    </div>

CSS
/* Sliding banner element */

#sliderContent { width:900px; padding:0 0 0 0;}
.viewer { width:900px; height:299px; padding:0px; overflow:hidden; position:relative;}
.content-conveyor { width:900px; height:299px; position:relative; }
.item { width:450px; height: 299px; float:left;}

#slider {
margin: 10px 0 0 0;
}
.ui-slider-horizontal {
    height: 4px;
    background: url(../images/slider_bg.png;);
    border: none;
    width: 900px;
    float: left;
}

.ui-slider .ui-slider-handle {
    cursor: default;
    height: 15px;
    position: absolute;
    width: 25px;
    z-index: 2;
    background: url('../images/slider_handle.png') no-repeat;
    border: none;
}

javascript

<script type="text/javascript">
      $(function() {

        //vars
        var conveyor = $(".content-conveyor", $("#sliderContent")),
        item = $(".item", $("#sliderContent"));

        //set length of conveyor
        conveyor.css("width", item.length * parseInt(item.css("width")));

        //config
        var sliderOpts = {
          max: (item.length * parseInt(item.css("width"))) - parseInt($(".viewer", $("#sliderContent")).css("width")),
          slide: function(e, ui) { 
            conveyor.css("left", "-" + ui.value + "px");
          }
        };

        //create slider
        $("#slider").slider(sliderOpts);
      });
    </script>
  • 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-23T22:27:34+00:00Added an answer on May 23, 2026 at 10:27 pm

    The slider position is based on the left most position of the helper. You need to do a have a wrapper around it for positioning, and pull the helper back with a margin of half it’s width.

    See the following jsFiddle for a solution using your code.

    http://jsfiddle.net/Bprw2/1/

    Or http://jqueryui.com/demos/slider/#side-scroll and open the source for a more extensive example.

    Hope this helps

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

Sidebar

Related Questions

I have a page that has multiple sliders (from http://www.switchonthecode.com/tutorials/using-jquery-slider-to-scroll-a-div ) and since each
I have a JQuery silder that I'm using to set the score on a
I am using Easy Slider 1.7 - jQuery plugin and have made many modifications.
I have a web site with a jQuery slider that automatically slides when the
I have a jquery slider that I have built, basically just three pannels that
I have 4 icons that, on mouse over, scroll a div using jQuery animate.
I have a StackPanel inside of a ScrollViewer. I have a slider that does
I have this menu structure that is used to navigate through content slider panels.
I have some HTML and jQuery that slides a div up and down to
Hi everyone my problem today is I have a couple of buttons that slide

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.