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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:39:29+00:00 2026-05-18T10:39:29+00:00

Can anybody help me on this one…I have a button which when is hovered,

  • 0

Can anybody help me on this one…I have a button which when is hovered, triggers an action. But I’d like it to repeat it for as long as the button is hovered.

I’d appreciate any solution, be it in jquery or pure javascript – here is how my code looks at this moment (in jquery):

var scrollingposition = 0;

$('#button').hover(function(){
++scrollingposition;
    $('#object').css("right", scrollingposition);
    });

Now how can i put this into some kind of while loop, so that #object is moving px by px for as #button is hovered, not just when the mouse enters it?

  • 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-18T10:39:30+00:00Added an answer on May 18, 2026 at 10:39 am

    OK… another stab at the answer:

    $('myselector').each(function () {
      var hovered = false;
      var loop = window.setInterval(function () {
        if (hovered) {
          // ...
        }
      }, 250);
    
      $(this).hover(
        function () {
          hovered = true;
        },
        function () {
          hovered = false;
        }
      );
    });
    

    The 250 means the task repeats every quarter of a second. You can decrease this number to make it faster or increase it to make it slower.

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

Sidebar

Related Questions

Can anybody please help me with this as I have no idea why public
Console dogs me. Can anybody help? The sad story starts like this. My OS
Can anybody help me with this simple code?? #include <iostream> using namespace std; void
can anybody help me solve this : i got $filename= index 198.php; i use
Can anybody help me to build an XSD file to validate XMLs like these:
Can anybody help me out to know the possible reasons for which Apple store
Can anybody help with a valid regex ? I have a files containing functions
Can anybody help me make this work, the idea is , if a post,
I have dynamicaly added input fields like this one: <input id=person__1_badge_number class=number type=text size=12
can any body help me on separating this example of data that i need

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.