Advertisement
Guest User

Untitled

a guest
May 12th, 2012
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var div = $("div"), p = $("<p />").appendTo(div);
  2.  
  3. div.data("p", p).click(handler);
  4.  
  5. function handler(event) {
  6.    
  7.     // much faster
  8.     $(this).data("p").css("margin-top", 100);
  9.    
  10.     // than this
  11.     $(this).children("p").css("margin-top", 100);
  12.    
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement