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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:33:06+00:00 2026-05-27T21:33:06+00:00

I’m working on a project that uses SVG with Raphael.js . One component is

  • 0

I’m working on a project that uses SVG with Raphael.js. One component is a group of circles, each of which “wiggles” around randomly – that is, slowly moves along the x and y axes a small amount, and in random directions. Think of it like putting a marble on your palm and shaking your palm around slowly.

Is anyone aware of a Raphael.js plugin or code example that already accomplishes something like this? I’m not terribly particular about the effect – it just needs to be subtle/smooth and continuous.

If I need to create something on my own, do you have any suggestions for how I might go about it? My initial idea is along these lines:

  • Draw a circle on the canvas.
  • Start a loop that:
    • Randomly finds x and y coordinates within some circular boundary anchored on the circle’s center point.
    • Animates the circle from its current location to those coordinates over a random time interval, using in/out easing to smooth the effect.

My concern is that this might look too mechanical – i.e., I assume it will look more like the circle is tracing a star pattern, or having a a seizure, or something like that. Ideally it would curve smoothly through the random points that it generates, but that seems far more complex.

If you can recommend any other code (preferably JavaScript) that I could adapt, that would be great too – e.g., a jQuery plugin or the like. I found one named jquery-wiggle, but that seems to only work along one axis.

Thanks in advance for any advice!

  • 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-27T21:33:07+00:00Added an answer on May 27, 2026 at 9:33 pm

    Something like the following could do it:

        var paper = Raphael('canvas', 300, 300);
        var circle_count = 40;
        var wbound = 10; // how far an element can wiggle.
        var circleholder = paper.set();
    
        function rdm(from, to){
               return Math.floor(Math.random() * (to - from + 1) + from);
        }
    
        // add a wiggle method to elements
        Raphael.el.wiggle = function() {
            var newcx = this.attrs.origCx + rdm(-wbound, wbound);
            var newcy = this.attrs.origCy + rdm(-wbound, wbound);
            this.animate({cx: newcx, cy: newcy}, 500, '<');
        }
    
        // draw our circles
        // hackish: setting circle.attrs.origCx
        for (var i=0;i<circle_count;i++) {
            var cx = rdm(0, 280);
            var cy = rdm(0, 280);
            var rad = rdm(0, 15);
            var circle = paper.circle(cx, cy, rad);
            circle.attrs.origCx = cx;
            circle.attrs.origCy = cy;
            circleholder.push(circle);
        } 
    
        // loop over all circles and wiggle
        function wiggleall() {
            for (var i=0;i<circleholder.length;i++) {
                circleholder[i].wiggle();
            }
        }
        // call wiggleAll every second
        setInterval(function() {wiggleall()}, 1000);
    

    http://jsfiddle.net/UDWW6/1/

    Changing the easing, and delays between certain things happening should at least help in making things look a little more natural. Hope that helps.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the

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.