[英]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.