하나의 라이브 이벤트에 여러 함수를 바인딩 할 수 있는지 궁금합니다. 당신이 원하는 무엇을jquery .live의 다중 함수
$('.block a.submit').live("click",
function(){
$(this).text('Save').parent().each(function(){
$(".value", this).hide();
$(".edit", this).show();
$(this).find('.edit :first').focus(); //focuses on first form element - less clicks
$('thead').show();
});
},
function(){
$(this).text('Edit').parent().each(function(){
$(".edit", this).hide();
$(".value", this).show();
$('thead').hide();
});
}
);
라이브 이벤트가 '클릭'이 아니라 '호버'인 경우 유효합니다. – Neal
@Neal, 아니요. '.live()'메소드는 이벤트에 바인드 할 단일 메소드를 허용합니다. 'hover' 이벤트에 대해서 그것은'mouseenter'와'mouseleave' 둘 다에 제공된 단일 메소드를 바인딩 할 것입니다. –