Код: Выделить всё
sf_th_hoverКод: Выделить всё
document.addEventListener("DOMContentLoaded", function ()
{
console.log("Fix für sf_th_hover aktiv!");
function removeHoverEffect()
{
document.querySelectorAll(".sf_th_hover").forEach(header =>
{
header.addEventListener("mouseleave", function ()
{
this.classList.remove("sf_th_hover");
console.log("sf_th_hover entfernt:", this);
});
});
}
removeHoverEffect();
new MutationObserver(mutations =>
{
mutations.forEach(mutation =>
{
mutation.addedNodes.forEach(node => {
if (node.nodeType === 1 && node.classList.contains("sf_th_hover"))
{
console.log("Neues sf_th_hover gefunden:", node);
node.addEventListener("mouseleave", function ()
{
this.classList.remove("sf_th_hover");
console.log("sf_th_hover entfernt (durch MutationObserver):", this);
});
}
});
});
}).observe(document.body, { childList: true, subtree: true });
});
Код: Выделить всё
$(document).on("mouseenter", "th", function () {
$(this).removeClass("sf_th_hover");
console.log("Fix: sf_th_hover wurde entfernt!");
});
$(document).off("mousemove", "th");
< /code>
Но произошла ошибка: < /p>
uncaught typeerror: $ (...). On не функция < /p>
, которая относится к строке $ (document) .on ("mouseenter", "th", function () {Я не могу включить jQuery, так как она ломает страницу. < /p>
Я не знаком с JavaScript. />
Код в сетке такова:
Код: Выделить всё
_mouseMove = function () {
var _e = $(this);
if (this.tagName != 'th') $(this).parents('th:first');
_e.toggleClass('sf_th_hover');
},
Подробнее здесь: https://stackoverflow.com/questions/794 ... javascript
Мобильная версия