[jQuery] Using append() - each element or string of HTML?

2009-09-18 Thread Kaitlyn
Just wondering from an efficiency standpoint: I am building a widget out of javascript and so there is a lot of HTML. Am I better off creating it as a string, then append() it into the document, or should I build the widget itself using append() and other related helper functions?

[jQuery] Problem animating with marginLeft...

2007-08-11 Thread Kaitlyn
I have this: $('#mydiv').animate({marginLeft:100}, 500); it works just fine in Firefox and Safari. In IE (6 and 7) I get "Invalid argument". If I use this instead: $('#mydiv').css({marginLeft:100}); It works in ALL browsers, including IE. What's wrong? The comment above the animate() function

[jQuery] How to animate percentage?

2007-08-01 Thread Kaitlyn
how do I make something like this: $('#element').animate({marginLeft:25}, 500); by percent, instead of 25 pixels?