右擊鏈接


在上圖按下鼠標右鍵試圖下載,
結果是被帶出本頁。

辦法簡單,您只需要添加onMouseDown="window.location=this.href"到鏈接標記裡。

例如:
<a href="1.html" onMouseDown="window.location=this.href">圖像名稱</a>

此外,也須要在<head>和</head>之間加入下列標記,阻止在圖像上出現下載工具:

<meta http-equiv="imagetoolbar" CONTENT="no">

就是如此簡單!
請享用