由于您正在动态加载内容,因此替换
body事件处理程序的内容的可能性极高。
要解决此问题,您需要调整点击处理程序以使用
live()或
delegate()
$('a').live("click", function(e){ e.preventDefault(); loadPage(e.target.href); direction = $(this).attr('class');});
由于您正在动态加载内容,因此替换
body事件处理程序的内容的可能性极高。
要解决此问题,您需要调整点击处理程序以使用
live()或
delegate()
$('a').live("click", function(e){ e.preventDefault(); loadPage(e.target.href); direction = $(this).attr('class');});