[jQuery] Re: Float Image on Page

2009-06-30 Thread Nic Hubbard
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

[jQuery] Re: Float Image on Page

2009-06-29 Thread James
You can position the object with CSS position: absolute and write a script to change it's top and left CSS attribute. On Jun 29, 1: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

[jQuery] Re: Float Image on Page

2009-06-29 Thread mkmanning
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); } ); }

[jQuery] Re: Float Image on Page

2009-06-29 Thread Nic Hubbard
Thanks! This is just what I was looking for! 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() *

[jQuery] Re: Float Image on Page

2009-06-29 Thread Nic Hubbard
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(){