Leave a Comment
            jQuery.delegate
jQuery.delegate и jQuery.undelegate появились в jQuery 1.4.2. Это аналоги .live и .die().
У .live и .die() есть проблемы с, к примеру, вложенными объектами, с встраиванием в цепочки и много ещё.
Синтаксис .delegate отличается от .live и, соответственно, .click и т.п.
Пример использования:
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  | 
						// Using .live()   $("table").each(function(){     $("td", this).live("hover", function(){       $(this).toggleClass("hover");     });   }); // Using .die()   $("table").each(function(){     $("td", this).die("hover");   }); // Using .delegate()   $("table").delegate("td", "hover", function(){     $(this).toggleClass("hover");     }); // Using .undelegate()   $("table").undelegate("td", "hover");  | 
					
http://api.jquery.com/delegate/
Работа с событиями в jQuery 1.7+
Similar Posts
LEAVE A COMMENT
Для отправки комментария вам необходимо авторизоваться.