views:

778

answers:

8

I'm trying to create web applications that use Javascript. I'd like to be able to use animation in these applications. I've tried to use basic Javascript, but I've decided that the best thing to do is to use a library (such as YUI or JQuery).

I'm running into a problem. On Safari, when I run animation scripts, the animation is very chunky, very blocky. This happens with YUI as well as basic Javascript. Does anybody know why this happens? Are there any good libraries that don't create this problem in Safari, but are also good for IE and Firefox (and, hopefully, Opera)?

Thanks, Jason

A: 

JQuery has animation, but I don't know what it is like on a Mac (I don't have a mac). If things are going slow, then you are probably making the animations too complicated. Remember, JavaScript is a slow language, and DOM is not designed for animation, so try to limit yourself with respect to the number of animations at the same time. Always ask if the animation is really necessary.

Marius
A: 

Well, for starters you could use CSS Transformations if the application is Safari-specific. Otherwise JQuery got some built in animations and a big community behind it (and thus, a large plugin repository).

Andy
A: 

What version of Safari are you using? Can you point us to a site with an example using one of the mentioned technologies so we can try to reproduce the problem in various browsers (and browser version numbers)?

Jared Updike
A: 

You could download Safari for Windows and see if it's the same there. If it isn't, then you have something up with your Mac, I suspect. I have never seen anything like this and Safari is my main browser.

Flubba
A: 

You could try Dojo's GFX.

Dojo GFX API

andyuk
+2  A: 

I have found mootools to be pretty slick for animations, just a little smoother than JQuery.
Generally prefer JQuery, which I find to be a little more intuitive (in my head anyway), but would go mootools if slick animation is your biggest requirement.

seanb
A: 

You can download some sample code and check locally to make sure that things are supposed to work. For example, you can get the source code for B&K's jQuery book at http://www.manning.com/bibeault/ (check out the source link) and try out the samples for Chapter 5. If those pages work (locally) for you on Safari, then at least you know your basic environment is sane.

I'm having similar problems, and I suspect there are Safari bugs that jQuery is tripping over. But I haven't yet figured out whether it's me writing sloppy code (with FF perhaps being more forgiving than Safari), or if it's Safari, or if it's jQuery. I'll post more if I get any wiser.

Peter S Magnusson
A: 

Strange, Webkit (The javascript engine that Safari uses) is supposed to be pretty fast. Make sure that you have the latest version, there have been great progress for the javascript eninges in the Safari and Firefox releases in recent time. Also, i think dojo and mootools have faster animations than jQuery, at least in my experience.

finpingvin