我想要不同的事件,不同的显示模式:
.on("enter leave", function (e) {
$("#artwork figcaption").style.display(e.type == "none" ? "block" : "none");
});
答案 0 :(得分:0)
我建议您使用.css()
:
.on("mouseenter", function (e) {
$("#artwork figcaption").css("display", e.type == "mouseenter" ? "block" : "none");
});
或在.css()
中使用回调:
.on("mouseenter", function (e) {
$("#artwork figcaption").css("display", function(){
return e.type == "mouseenter" ? "block" : "none";
});
});