我創建了一個風格化的頁面,並且已經更改了默認光標,但是當您將鼠標懸停在鏈接上時,它會返回到標準「指針」。我想改變標準指針,就像我使用默認光標一樣。我嘗試了一些我發現的JavaScript,但它似乎沒有工作。在更改默認光標後更改指針
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../css/basic.css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script>
var elms = document.getElementsByTagName("*");
var n = elms.length;
for(var i = 0; i < n; i ++) {
if(window.getComputedStyle(elms[i]).cursor == "pointer") {
elms[i].style.cursor = "url(../img/cursor.png)";
}
}
</script>
</head>
<body>
<a>
<a>
</body>
</html>
,這是CSS光標
html{
min-width: 100%;
min-height:100%;
cursor: url(../img/cursor.png),auto;
}
body{
background-color: black;
cursor: url(../img/cursor.png),auto;
}
你能發佈整個img鏈接嗎? – imbondbaby
這是你的意思嗎? 'file:/// J:/ Graphic/webfolio/img/cursor.png' –