Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 4th, 2012  |  syntax: None  |  size: 1.18 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Is $(document.body) and document.body the same? Cleaning garbage and binding in class? - MooTools 1.3
  2. this.css = null;
  3.  
  4. window.addEvent('domready', function(){
  5.  
  6.     this.document = $(document);
  7.     this.body = $(document.body);
  8.     this.head = $(document.head);
  9.  
  10. }.bind(this));
  11.        
  12. this.css = null; // Maybe this.css = '' - empty string?
  13.        
  14. window.addEvent() // or should I use $(window).addEvent()
  15. this.document = $(document) // or this.document = document
  16. this.body = $(document.body) // or this.body = document.body
  17.        
  18. (function(){
  19.   this.setStyle('overflow-y', 'visible');
  20.  }.bind(this.body)).delay(100);
  21.        
  22. (function(){
  23.   this.body.setStyle('overflow-y', 'visible');
  24.  }.bind(this)).delay(100);
  25.        
  26. myElement.destroy();
  27.        
  28. window.addEvent(); // is fine.
  29. document.body.adopt(new Element("div")); // not fine in IE.
  30. new Element("div").inject(document.body); // fine.
  31.        
  32. $(document.body).adopt(new Element("div")); // fine.
  33. document.body.adopt(new Element("span")); // now fine, after first $.
  34.        
  35. (function(){
  36.       this.setStyle('background', 'blue');
  37.  }).delay(100, $("foo"));
  38.        
  39. (function(){
  40.       this.element.setStyle('background', 'blue');
  41.       this.someMethod();
  42.  }).delay(100, this));