$(preview-button).click(...)
$(preview-button).slide(...)
$(preview-button).whatever(...)
Is it a better practice to do this:
var p
It is much faster to use a named variable rather than passing jQuery a selector once for each action. However, as it was already mentioned, chaining is an optimal solution in most cases. You can see it for yourself. Here is a test I just did:
UPDATE:
Apparently Firefox does some kind of caching and the three cases perform very similarly. On the other side Chrome and Safari have a rather poor performance in Case 1, compared against cases 2 and 3 (especially as number or nodes increases).