[英]Replace cursor with image when hovering over background 1
我正在嘗試顯示png而不是我的網站第1階段的光標。 背景圖像轉換使用jQuery,其余轉換使用PHP,CSS,HTML。 我研究並使用了每個人似乎都在使用的代碼,但光標不會出現。 我檢查了圖像的命名和路徑是否正確。 Chrome上的Inspect元素也未顯示任何錯誤。 讓我知道您是否能找到錯誤...
光標應僅顯示第一個背景(“頂部”)。 任何提示高度贊賞!
CSS:
.top {
position: absolute;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
z-index: 100;
width: 100%;
}
.top: hover {
cursor: url("images/cursorcamera.png");
jQuery的
$(document).ready(function(){
var audioElement = document.createElement('audio');
audioElement.setAttribute('src', 'audio/camera.wav');
$('*').click(function(){
audioElement.play();
$('.top').fadeOut('slow')
// $('.second').fadeOut('slow').delay(1000);
$('.second').delay(5000).fadeOut();
$('#counter').delay(5000).fadeOut();
});
});
不要使用懸停。 在頂部CSS元素中聲明光標URL,當您將鼠標懸停在Element上時,它將起作用。
我嘗試了這個,但指針顯示了,而不是圖像...所以它以某種方式起作用而不是圖像...
.top {位置:絕對; 頂部:0px; 底部:0px; 左:0px; 右:0px; z索引:100; 寬度:100%; 光標:url(images / cursorcamera.png),指針; }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.