当您使用 jQuery 可调整大小插件时,鼠标光标样式可以为“e-resize”(相反方向的 2 个箭头)。但是,我们怎样才能改变它呢?我试过这个:
$("#right-line").hover(function() {
$(this).css("cursor", "crosshair");
});
但是,它不起作用,即光标仍然是“e-resize”。
提前谢谢您。
最佳答案
要覆盖 Jquery 可调整大小的光标,您可以执行以下操作:
$(selector).resizable({
handles: "e",
create: function( event, ui ) {
// Prefers an another cursor with two arrows
$(".ui-resizable-e").css("cursor","ew-resize");
}
});
关于jquery - 如何在 jQuery 可调整大小插件中更改鼠标光标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10751333/