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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:45:25+00:00 2026-05-14T23:45:25+00:00

Good day all, I am tasked with building a slider for our site. Here

  • 0

Good day all, I am tasked with building a slider for our site. Here is my goal:

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

I need to move “slider” left 30px at a time when a button is hovered over, and right 30px when another button is hovered over.

My problem is that there doesn’t seem to be a reliable method for telling the code that the mouse hasn’t left the are in question, unless there is something I did not think about or read yet. In other words, when the mouse is OVER the a button, the code to move “slider” left is executed until the mouseout is called. I’m not really sure how to do this.

The only way I can think of is to look at the offsetTop and offsetLeft and offsetTop DOM properties and compare them to the mouse position, than run checks to see if the mouse is within the bounds of the box, and if not than it will stop the execution of code.

Is there a better way to do this?

  • 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-14T23:45:26+00:00Added an answer on May 14, 2026 at 11:45 pm

    This is fairly easy.

    var timerID;
    $("#left").hover(function() {
      timerID = setInterval(slideLeft, 1000);
    }, function() {
      clearInterval(timerID);
    });
    
    function slideLeft() {
      $("#slider").animate({left: -30});
    }
    

    and similar for right.

    You only need to use hover() if there’s something you need to stop when the mouse leaves the area. Otherwise you can simply use the mouseover() event.

    Note: the actual effect I’ve put in there probably isn’t right but it depends entirely on the slider plugin you’re using. Adjust as required.

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

Sidebar

Related Questions

Good day to all. I have a booking site. Here I need to integrate
Good day to all. I need to create a graphical countdown in js. The
Good day to all. I have this structure <html> <iframe> <div id=idd>Some Content</div> </iframe>
Good Day all, I have an existing site built. I was wondering, how can
Good day to all. I have a site (created with zend framework and smarty)
Good day to all. I need to loop a flv file in flash if
Good day All, A mix-up at the printers (or on our end) has resulted
Good day to all. I need to send a request to a script and
Good day to all! What I have here is setting up subform elements and
Good day to all. I have a movie that need 2 be displayed with

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.