views:

94

answers:

2

Hi all,

I am currently using JQuery to perform a single task: animation of width on a div. I really hate to be loading in the entire JQuery library for this single task and was wondering if anyone knew how to do a standalone function like:

div.animate('56');

Where 56 is the percentage of the width I'd like the div to animate to. If anyone has any advice or ideas, I'd really appreciate it!

Ben

+1  A: 

To be honest, at 55kb (or 19kb if your server supports gzip), I'd just go with jQuery.

However, this page looks like it has some scripts and info to help you do what you want:

http://www.hesido.com/web.php?page=javascriptanimation

And the source is here:

http://www.hesido.com/web/animfunctions.js

Mark B
Normally I would just go with JQuery but its going to be used for widgets on other sites...so I need it to be as lightweight as possible. These links helped a good amount though, so thank you!
Ben
A: 

Certainly possible, but it's generally a pain to get animations working properly across the standard array of browsers.

If jQuery/jQuery UI is overkill for what you're doing, you may want to give smaller libraries like MooTools and moo.fx a try. Also take note that Google offers a javascript API to include libraries that are likely to already be cached on a user's browser.

Damien Wilson