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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:58:02+00:00 2026-05-26T17:58:02+00:00

Basically I’m trying to fix the Jquery Tools 1.2.6 Scrollable’s strange habit of scrolling

  • 0

Basically I’m trying to fix the Jquery Tools 1.2.6 Scrollable’s strange habit of scrolling past the last item if the number of items is not evenly divided by the scroll size.

In other words if I have a widget that contains 11 items and it is set to display 2 at a time and each time the next button is clicked to scroll to the next 2 items, when it comes to the eleventh item it will scroll so the eleventh displays but with an empty space to the right where the twelfth item would be were there one. Essentially scrolling the next 2 into the view despite the absence of the second item

Here I have a jsFiddle that demonstrates my fix: http://jsfiddle.net/natepers/6kmuE/21/

I managed to get it to stop at the last item by resetting the scroll-size to the remaining number of items less than the scroll-size;

Problem is I can’t get it back to the first item.

Here’s the javascript:

var scrollable = $(".scrollable").data("scrollable");
var size = scrollable.getConf().size;

// Catch any requests for items at the end of the list
scrollable.onSeek(function(event, index) {

    var self_size = this.getSize();

    // Last vsisible item
    var last = index + size;

    // How many to the last item
    var difference = self_size - last;

     // How many more than the scroll size
    var remainder = index%size;

    //reset scroll size for each request
    scrollable.getConf().size = size;


    // If next request has items but less than the scroll size
    if ( remainder == 0 && difference < size && difference > 0 ) {

            // Set the scroll size to th enumber of items left
           scrollable.getConf().size = difference;
    }
    //If we're at the end
    if (index++ === self_size - size) {

            // Set disabled style on next button
             $("a.next").addClass("disabled");   
    }
    //If the items are not evenly divided by the scroll size we know we're at the end
    if (remainder != 0) {

            // Set scroll size to the what's left 
            scrollable.getConf().size = remainder;        
    }
});

// Stop scrolling at last item
scrollable.onBeforeSeek(function(event, index) {
  var self_index = this.getIndex();
  var self_size = this.getSize();
  var last = self_index + size;
    //If the last visible item is the last item
  if (last == self_size) {
      // If the next requested item is >= the last item do nothing
      if (index > self_index) { return false; }
  }
});

Thanks for any suggestions or help.

  • 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-26T17:58:03+00:00Added an answer on May 26, 2026 at 5:58 pm

    I recently had this same problem. The solution in this blog post below seems to work well for me in jQuery Tools 1.2.6

    http://www.jasoncarr.com/technology/jquery-tools-scrollable-stop-scrolling-past-the-end

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

Sidebar

Related Questions

Basically what i'm trying to do is read a number from a file, increment
Basically I've made a form in Cakephp 2.1 with a jQuery button that appends
Basically, what I'm trying to create is a page of div tags, each has
Basically what I'm trying to do is make a very simple vertical bullet projectile
basically I have a function that resizes elements accordingly with jquery triggering the function
Basically i'd like to allow an arbitrary (but not empty ) number of key-value
Basically my question is, if I have a number string, and i'm going to
Basically what I'm trying to do is generate an alphanumeric string, which is passed
Basically what i am trying to do here is to read from the table
Basically, I've been trying nXhtml mode, and it's terribly slow and buggy in Emacs

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.