[jQuery] Using variables or jquery selectors when chaining?

2009-07-10 Thread north
Hi, is it better to do this (regarding performance not readability): $('a.updateCartButton').click(function() { $('form[name=updateCartForm]').attr('action', $(this).attr('href')+'#'+ $('img[id^=iconUpdateArticle]').attr('id')).submit(); return false; }); or this:

[jQuery] using variables with jquery

2008-05-06 Thread quirksmode
Hi, I need to make a div slide across the screen using the animate command. It works when I use the following: $('#js_innerwrapper').animate({left:+=500}, 1000, 'easeOutSine'); However, i need to be able to change the 500 to be width of the div, which i get using: $.gamewidth =