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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:26:16+00:00 2026-05-24T13:26:16+00:00

I am currently working on creating a vertical scroller and have got so far

  • 0

I am currently working on creating a vertical scroller and have got so far but have got stuck on some of the functionality

My HTML looks like this

<div class="outer">

    <div class="slider-content clearfix">
        <ul>
        <li><img src="images/img1.jpg" width="200" height="200" alt="img1"></li>
        <li><img src="images/img2.jpg" width="210" height="200" alt="img2"></li>
        <li><img src="images/img3.jpg" width="220" height="210" alt="img3"></li>
        <li><img src="images/img4.jpg" width="210" height="200" alt="img4"></li>
        <li><img src="images/img5.jpg" width="200" height="200" alt="img5"></li>
        <li><img src="images/img6.jpg" width="210" height="200" alt="img6"></li>
        <li><img src="images/img7.jpg" width="220" height="153" alt="img7"></li>
        <li><img src="images/img8.jpg" width="200" height="200" alt="img8"l></li>
        <li><img src="images/img9.jpg" width="200" height="200" alt="img9"></li>
        <li><img src="images/img10.jpg" width="200" height="200" alt="img10"></li>
        <li><img src="images/img11.jpg" width="200" height="200" alt="img11"></li>
        <li><img src="images/img12.jpg" width="200" height="200" alt="img12"></li>
        <li><img src="images/img13.jpg" width="220" height="210" alt="img13"></li>
        </ul>
    </div>

</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="script.js"></script>

My CSS is as follows

*{margin:0px;padding:0px;}
 li{list-style:none;float:left;height:200px;width:200px;}
.clearfix { overflow: hidden; display: inline-block; }
.clearfix { display: block; }
.outer{margin:45px auto;position:relative;height:500px;width:515px;border:1px solid  #333;overflow:hidden;}
.slider-content{position:absolute;top:0px;left:0px;}
.top-hover, .bottom-hover{width:515px;height:50px;background:#ccc;}
.top-hover{position:absolute;top:0px;z-index:500;}
.bottom-hover{position:absolute;bottom:0px;}

and finally my js

$(function(){

$('.outer').prepend('<div class="top-hover"></div>');
$('.slider-content').after('<div class="bottom-hover"></div>'); 

//Get height of outer container and slider
var outerHeight = $('div.outer').height();
var contentHeight = $('div.slider-content').height();
// Calculate cut off point of displayed contents
var contentExcess = contentHeight - outerHeight;
//store end point of scroll
var maxTopScroll = 0 - contentExcess
var speed = 45;
var hovered = false;


//Hover over top div
$('div.top-hover').hover(
function(){

    //Get the position of the slider content div and store in sliderPositionTop
    var sliderPositionTop = $('.slider-content').position().top;
    // if slider position is less than 0 animate down
    if(sliderPositionTop < 0){
         // alert(sliderPositionTop);
        $('.slider-content').animate({
            top: sliderPositionTop + speed
        });

    } else {
        //If slider is greater than 0 stop animation
            if(sliderPositionTop > 0){
                $('div.top-hover').stop();
                $('.slider-content').css('top', '0px');
            }
         alert('No movement');
    }   
},
function(){
    return false;
  });




 //Hover over bottom div
 $('div.bottom-hover').hover(
function(){
    //Get the position of the slider content div and store in    sliderPositionBottom
    var sliderPositionBottom = $('.slider-content').position().top;
    // If slider is less / equal to 0 then animate slider
        if(sliderPositionBottom <= 0){
             // alert(sliderPositionBottom);
            $('.slider-content').animate({
                top: sliderPositionBottom - speed   
            }); 
        } else {
            //If scroll reaches max then stop
             alert('No movement');
        }
},
function(){
    return false;
}
  );

  });

Currently the scroller moves up and down when you hover over the top and bottom buttons however you have to keep moving in and out of the hover area in order to get the scroller to move

My question is how can you make it so that it will do a continous scroll of the scroll-content div

Also currently the script has no way to limit the end of the scroll-content div and I cant seem to get it to stop once it gets to the bottom of this div

Any ideas are grateful

Cheers

  • 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-24T13:26:16+00:00Added an answer on May 24, 2026 at 1:26 pm

    I think the jquery jScrollPane plugin has just what you’re looking for. It’s easily skinned with css and has lots of examples.

    jScrollPane – arrow hover example
    http://jscrollpane.kelvinluck.com/arrow_hover.html

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

Sidebar

Related Questions

I am currently working in a .Net project but from university I have also
Im currently working on creating some appwidgets for my application; one of those is
I am currently working on creating a header file that acts like the standard
I'm currently working on creating a new C# project that needs to interact with
Currently working on a VBScript to automate some of the dirty PST ingestion work
I`m currently working on a script, and I have the following situation. function somnicefunction()
I'm currently working on creating a custom connection provider for HNibernate very similar to
I'm creating a game, and am currently working on the Inventory system for it.
I'm currently working on a cross-platform mobile app and have gone through the process
I am currently working on some personal tests and benchmarks to compare the workflow

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.