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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:59:11+00:00 2026-06-06T06:59:11+00:00

I wrote a sliding list for a project. Here it is: http://study-wise.appspot.com/test/left_right.html I have

  • 0

I wrote a sliding list for a project.
Here it is:
http://study-wise.appspot.com/test/left_right.html

I have been wondering, is there a better way to do this?
Like something built-in to jquery-ui
Thanks
I’m wondering for learning purposes and also, if there isn’t I’d like to post it somewhere so it could be used.

<html>
    <head>
        <title>
            test
        </title>

CSS

        <style type="text/css">
            *{
                margin: 0px;
                padding: 0px;
            }
            a.move {
                z-index: 2;
                position: absolute;
                height: 28px;
                width: 28px;
                display: inline-block;
                border: 1px #aaa solid;
                border-radius: 5px;
                background-color: white;
                text-align: center;
                text-decoration:  none;
                color: black;
            }
            a.move:hover {
                background-color: #aaa;
            }
            a.move.left {
                top: 0;
                left: 0;
            }
            a.move.right {
                top: 0;
                left: 370px;
            }
            ul#shifting li {
                display: inline-block;
                height: 30px;
                width: 335px;
                border-right: 1px #aaa solid;
                margin-left: 35px;
            }

            div.slidingList_outer{
                z-index: 1;
                position: relative;
                width: 741px;
                height: 30px;
                border: 4px #24a solid;
                overflow: hidden;
            }
            div.slidingList_inner{
                position: relative;
                width: 1200px;
                height: 30px;
            }

        </style>

JQUERY

        <script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
        <script type="text/javascript">
            var current = 0;
            var total = 0;
            var wait = 0;
            var width = 335;
            var margin = 35;
            function next(){
                if(wait || current == total - 1) return;
                wait=1;
                $('li:eq(' + (current + 2) + ')').show();
                $('li:eq(' + (current + 0) + ')').animate({
                    marginLeft: "-" + (width) + "px"
                  }, 1000, function(){update(+1);});
            }
            function prev(){
                if(wait || current == 0) return;
                wait=1;
                $('li:eq(' + (current - 1) + ')').css({marginLeft: "-" + (width) + "px"}).show().animate({
                    marginLeft: "" + (margin) + "px"
                  }, 1000, function(){update(-1);});
            }
            function update(delta){
                if(delta == 1){
                    $('li:eq(' + (current + 0) + ')').hide();
                    $('li:eq(' + (current + 0) + ')').css({marginLeft: "" + (margin) + "px"});
                } else if(delta == -1){
                    $('li:eq(' + (current + 1) + ')').hide();
                }
                current+=delta;
                wait=0;
                $('p').text('current: ' + current);
            }
            function init(){
                total = $('li').size();
                $('ul').append('<li>End of lecture</li>');
                $('li').hide();
                $('li:eq(' + (current + 0) + ')').show();
                $('li:eq(' + (current + 1) + ')').show();
            }
            $(function(){
                init();
                /*bind events*/
                $('a.move.left').click(function(e){
                    e.preventDefault();
                    prev();
                });
                $('a.move.right').click(function(e){

                    e.preventDefault();
                    next();
                });
            });
        </script>
    </head>

HTML

    <body>
        <p> ... </p>
        <div class="slidingList_outer">
            <div class="slidingList_inner">
                <a class="move left" href="a">&lt;</a><a class="move right" href="b">&gt;</a>
                <ul id="shifting">
                    <li>123</li><!--
                    --><li>456</li><!--
                    --><li>789</li><!--
                    --><li>abc</li><!--

                    --><li>edf</li><!--
                    --><li>ghj</li><!--
                    --><li>!@#</li><!--
                    --><li>$%^</li><!--
                    --><li>ABC</li>
                </ul>
            </div>
        </div>
    </body>
</html>
  • 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-06T06:59:13+00:00Added an answer on June 6, 2026 at 6:59 am

    I would suggest jQuery Tools Scrollable if it does what you want.

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

Sidebar

Related Questions

I wrote a makefile which behaves oddly. You can find it here: http://pastebit.com/pastie/8215 Basically
I wrote a C++ DLL and it has been compiled. It requires Visual C++
I wrote the following: <html> <head> </head> <body> <input type=date /> </body> </html> Just
I have a problem with creating a sliding puzzle. I'm trying to make a
I wrote little wrapper subroutine to produce HTML-tables with HTML::Table , same time i
is there a way to avoid problems with jQuery's slideToggle()? I have a horizontal-sliding
lately I have been writing a lot of tiny plugins for my web projects
Previously I wrote on trying to convert some AS2 to AS3. It's a sliding
I am trying to show a list of survey by javascript. Here is the
Wrote a quick Java proggy to spawn 10 threads with each priority and calculate

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.