I figured it out, I just used the .each function so that each floater
would get a random value. :)

On Jun 29, 9:41 pm, Nic Hubbard <nnhubb...@gmail.com> wrote:
> Is there a way to make this more random?  Meaning, if I have multiple
> images, using the above script they all kind of go on the same
> direction.
>
> Thanks again.
>
> On Jun 29, 9:19 pm, mkmanning <michaell...@gmail.com> wrote:
>
>
>
> > Quick example:
>
> > $(document).ready(function(){
> > var floater = function(){
> >          $('img').animate( {'marginTop':(Math.random() * $(window).height())
> > + 'px','marginLeft':(Math.random() * $(window).width()) + 'px'},
> > 2000,'linear',function(){
> >                 setTimeout(floater,10);
> >          } );
>
> > }
> > floater();
> > });
>
> > Hope that can give you someplace to start.
>
> > On Jun 29, 4:32 pm, Nic Hubbard <nnhubb...@gmail.com> wrote:
>
> > > I have been trying to find a solution to this for a while, but all I
> > > can find is about style:float which is not what I want.
>
> > > I would like to animate an image randomly around the screen.  So, it
> > > could slowly float across the screen, and would randomly choose its
> > > motion.
>
> > > Any ideas?

Reply via email to