2011-07-12 193 views

回答

0

不要修改html,而要添加一個jQuery點擊事件lidata-href屬性。我一直覺得這樣做更安全,因爲這樣的問題

$('#rm_container li').click(function(){ 
    window.location.href = $(this).attr('data-href'); 
}); 

<li data-rotation="-5" data-images="rm_container_2" data-href='http://stackoverflow.com' data-transform="rotate(-5deg)" style="-moz-transform: rotate(-5deg);">