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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:36:20+00:00 2026-06-05T05:36:20+00:00

but only find scrolling solutions. What I’m trying to do is move a circle

  • 0

but only find scrolling solutions.

What I’m trying to do is move a circle across the screen using animate (left or right), then of course up / down, which I can do.

The issue is when I want the browser to scroll with the circle up / down if needed, in a nice smooth manner.

This is some simple quick dirty code I wrote just to mess around

$('#circle').animate({'left': (start)+'px'},'slow').fadeIn('slow', function(){
        $(this).animate({'left': '+='+(stopRight)+'px'}, 2000, function(){
            $(this).animate({'top': '+='+(downRight)+'px'}, 2000, function(){
                $(this).animate({'left': '-='+(leftRight)+'px'}, 2000, function(){
                });
            });
        });
    });

Where / how would i make it scroll, Any suggestions tip, I plan on getting ride of the code I have below anyways.

  • 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-05T05:36:22+00:00Added an answer on June 5, 2026 at 5:36 am

    This is a working solution, based on your animation sequence:

    See this working Fiddle Example!

    HTML

    <div id="circle"></div>
    

    CSS normalized on the Fiddle, but not relevant

    html, body {
      width: 100%;
      height: 100%;
    }
    #circle {
      width: 20px;
      height: 20px;
      background-color: #444;
      border: 1px solid #212121;
      border-radius: 10px;
      position: absolute;
      top: 300px;
      left: 300px;
    }
    

    jQuery You will need the plug-in .watch(), see link below

    // initial values to your variables
    var start     = 0,
        stopRight = 1000,
        downRight = 300,
        leftRight = 300;
    
    // your code as it was
    $('#circle').animate({'left': (start)+'px'},'slow').fadeIn('slow', function(){
      $(this).animate({'left': '+='+(stopRight)+'px'}, 2000, function(){
        $(this).animate({'top': '+='+(downRight)+'px'}, 2000, function(){
          $(this).animate({'left': '-='+(leftRight)+'px'}, 2000, function(){});
        });
      });
    });
    
    // the code to make it all happen!
    $('#circle').watch("left,top", function() {
        $("html, body").animate({
            scrollTop  : $('#circle').offset().top,
            scrollLeft : $('#circle').offset().left,
        }, 20);
    }, 100);
    

    Plug-in used

    jQuery CSS Property Monitoring Plug-in


    What this does is to track the element movement and manipulate the scrollbars to keep it visible at all times.

    The jQuery .scrollTop() Get the current vertical position of the scroll bar for the first element in the set of matched elements.

    The jQuery .scrollLeft() Get the current horizontal position of the scroll bar for the first element in the set of matched elements.

    The jQuery .offset() Get the current coordinates of the first element in the set of matched elements, relative to the document.

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

Sidebar

Related Questions

I'm trying to add Jumplist support to my app, but I can only find
I'm trying to find these sections of HTML, but only the ones of a
I've only been using SSIS briefly, but I find that my complaints are numerous.
I've googled but I could only find how to upload one file... and I'm
The only way I know is: find /home -xdev -samefile file1 But it's really
I did some research but only find ugly hacks , which uses unique name
I want to run a find command but only find the files in directories,
I've done some searching for the answer, but only find a lot of PHP
I was looking for a Linq RemoveFirst(Predicate<T> match) but could only find RemoveAll .
I currently have jquery Cycle running on a page, but not only find it

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.