超鏈標簽響應onclick事件時,防止頁面跳動方法
點擊一個<a>鏈接時,有垂直滾動條的話頁面會跳到頂端,so google it, and then finally found some ways:(sorry, i forgot the author.)
方法1:
<a href="#" onclick="test();return false">click me</a>
方法2:<a href="javascript:void(0)" onclick="test()">click me</a>
posted on 2012-04-07 14:59 Fly Without Wind 閱讀(3099) 評論(0) 編輯 收藏