$asj_3flickity-prev-next-buttonflickity-page-dots dotbuttonqqxmarkhoverfunction $kursoraddClasshovercursor; function $kursorremoveClasshovercursor; ;please convert this code to document on
The code you provided is written in jQuery. To convert it to JavaScript and apply the hover effect to the entire document, you can use the addEventListener method. Here's the updated code:
document.addEventListener('mouseover', function(event) {
var target = event.target;
if (target.matches('a, .sj_3, .flickity-prev-next-button, .flickity-page-dots .dot, button, .qqxmark')) {
document.querySelector('.kursor').classList.add('hovercursor');
}
});
document.addEventListener('mouseout', function(event) {
var target = event.target;
if (target.matches('a, .sj_3, .flickity-prev-next-button, .flickity-page-dots .dot, button, .qqxmark')) {
document.querySelector('.kursor').classList.remove('hovercursor');
}
});
This code listens for the mouseover and mouseout events on the entire document. If the event target matches any of the specified selectors, it adds or removes the hovercursor class from the element with the class kursor
原文地址: http://www.cveoy.top/t/topic/ioyn 著作权归作者所有。请勿转载和采集!