It's hard to tell anything else than I've just said based on this
information. If you use .animate() with each coordinates you get then
you have to set the duration to a smaller number as jQuery queues up
sequential animations by default, so the new one is only executed if
the previous one is finished. This makes the animation smoother but it
will react slower to sudden changes in the movement depending on the
duration. You can also stop the current animation as you get new
coordinates and start an other one based on them. For smooth movements
animating is also necessary even if you update the position on every
mousemove event (see the discussion I  mentioned).

But using purely the server for smooth animations ... I don't really
now how fast web sockets are (network connection and CPU time used)
but it sounds a bit hard to carry out -- at least for me :)

On Jan 12, 11:11 pm, meneldor <[email protected]> wrote:
> I compute where to move my object server side for better control. I
> use thathttp://www.devpro.it/xmlsocket/. I wanna use the browser
> only as client to visualize all elements.
>
> On 12 Ян, 23:56, Balazs Endresz <[email protected]> wrote:
>
> > Server side animation? What application is that? :)
>
> > I'd be really interested why would you do that, but I'd suggest
> > using .animate() for each coordinate you get from the server instead
> > of setting its height and width. And send coordinates less frequently
> > -- maybe just once and do the computation on the client.
>
> > Also, maybe this will be helpful 
> > too:http://groups.google.com/group/jquery-en/browse_thread/thread/51fe8e8...
>
> > On Jan 12, 3:02 pm, meneldor <[email protected]> wrote:
>
> > > Hi, group.
> > > Im trying to make animation using jquery, but its controlled server
> > > side using XMLSocket. When jQuery receive coordinates from server it
> > > moving my DIV across the browser but its too fast. I cant understand
> > > how to do smooth animation.  My server script (perl) compute the same
> > > x,y coordinates like jquery (i saw how in jQuery core) but i dont know
> > > how jquery delay all these x and y coordinates properly to make
> > > animation smooth. Ill be happy if someone explain me how it works.
> > > Excuse me for my english.
> > > Best Regards!

Reply via email to