////阻止事件冒泡函数 // 阻止默认浏览器动作(W3C) 要一起使用效果好
<a href="/Scripts/newfiber_js_lib/images/1.jpg" ><div onclick="historyImg(this, event)" class="txt_more">更多</div></a> function historyImg(dom,e) { stopBubble(e); stopDefault(e); } //阻止事件冒泡函数 function stopBubble(e) { if (e && e.stopPropagation) e.stopPropagation() else window.event.cancelBubble = true } // 阻止默认浏览器动作(W3C) function stopDefault(e) { // 阻止默认浏览器动作(W3C) if (e && e.preventDefault) { e.preventDefault(); } else { // IE中阻止函数器默认动作的方式 window.event.returnValue = false; } return false; }

 

相关文章:

  • 2021-06-01
  • 2021-07-20
  • 2022-12-23
  • 2022-12-23
  • 2021-04-25
  • 2022-12-23
猜你喜欢
  • 2021-07-08
  • 2022-12-23
  • 2021-04-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案