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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:13:15+00:00 2026-05-25T06:13:15+00:00

I am trying to use a very simple implementation of the scrollTo plugin: http://jsfiddle.net/TPQyY/

  • 0

I am trying to use a very simple implementation of the scrollTo plugin:

http://jsfiddle.net/TPQyY/

But I can’t get it to work. Any idea why it’s not scrolling horizontally to reveal the next image in the list?

<!doctype html>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="http://demos.flesler.com/jquery/scrollTo/js/jquery.scrollTo-min.js"></script>
<script type="text/javascript">
$(function() {

    $('.next').click(function(e) {
        $('ul#scrollThis').scrollTo( 'li:eq(1)', 1000, {axis:'x'} );    
        e.preventDefault(); 
    });

});
</script>

<style>

@import "http://developer.yahoo.com/yui/build/reset/reset.css";

body { padding: 100px; }

ul { list-style-type: none; width: 50px; height: 50px; overflow: hidden; }
ul li { float: left; }

</style>

<ul id="scrollThis">
    <li><img src="http://www.google.com/intl/en_com/images/srpr/logo3w.png" width="50" height="50" /></li>
    <li><img src="http://www.thecouchsessions.com/wp-content/uploads/2011/08/fat-cat.jpg" width="50" height="50" /></li>
    <li><img src="http://static.howstuffworks.com/gif/dog-best-friend-1.jpg" width="50" height="50" /></li>
</ul>

<a href="" class="next">Next >></a>
  • 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-25T06:13:16+00:00Added an answer on May 25, 2026 at 6:13 am

    Forget the plugin for a second, you are using an unordered list so the images are actually one after the other vertically, not horizontally. You can see this by removing the overflow: hidden css style.

    So you have a vertical list (down the Y axis) and you are locking the plugin to only scroll the x axis. If you remove the {axis:’x’} argument you will see it scroll vertically.

    If you want it to scroll horizontally then you just need to change your CSS for the UL to appear one after the other horizontally.

    UPDATE

    To achieve the horizontally aligned items (and therefore the horizontal scrolling), you need to change the UL to be wide enough to accomodate all of the items side by side (if you limit the width of the UL it will just push items down to the next line), and set white-space to nowrap.

    Then set the LI’s to display:inline (or you could use float:left I believe).

    Now you have the items side by side, you need to crop the view so only one is displayed. To do this wrap the UL in a container div and on this set the width and height so only one item is displayed and overflow to hidden.

    Finally change your scrollto, to tell the container to scroll not the list.

    This should achieve the result you are after.

    <!doctype html>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
    <script type="text/javascript" src="http://demos.flesler.com/jquery/scrollTo/js/jquery.scrollTo-min.js"></script>
    <script type="text/javascript">
    $(function() {
    
        $('.next').click(function(e) {
            $('#container').scrollTo( 'li:eq(1)', 1000, {axis:'x'} );    
            e.preventDefault(); 
        });
    
    });
    </script>
    
    <style>
    
    @import "http://developer.yahoo.com/yui/build/reset/reset.css";
    
    body { padding: 100px; }
    
    ul { list-style-type: none; white-space: nowrap; width: 70000px; }
    ul li { display: inline; }
    #container { width:50px; height:50px; overflow:hidden;  }
    
    </style>
    
    <div id="container">
        <ul id="scrollThis">
            <li><img src="http://www.google.com/intl/en_com/images/srpr/logo3w.png" width="50" height="50" /></li>
            <li><img src="http://www.thecouchsessions.com/wp-content/uploads/2011/08/fat-cat.jpg" width="50" height="50" /></li>
            <li><img src="http://static.howstuffworks.com/gif/dog-best-friend-1.jpg" width="50" height="50" /></li>
        </ul>
    </div>
    
    <a href="" class="next">Next >></a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use this library (which looks very nice) but I'm having difficulty
I'm trying to use a yaml config file as a very simple flat file
I'm trying to use AppWeb, and i wrote a very simple program to embed
I'm trying to use mustache templates to render very simple forms, however, one of
I am trying to use a very simple resource route for my Buildings Controller.
I have a very simple question, but I don't seem to get it right.
I am trying to use a very simple buttonlist. When the page loads everything
I'm trying to use linq to sql for my project (very short deadline), and
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
Trying to use a guid as a resource id in a rest url but

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.