我试图在单击时淡出该 block ,然后更改 block 位置,然后淡入。但这不起作用。代码如下:
$("#info-panel").fadeOut("fast");
$("#info-panel").css({
top: (new pos),
left: (new pos)
});
$("#info-panel").fadeIn("fast");
CSS:
#info-panel {
display: none;
position: absolute;
background-color: #333;
border: 1px solid #999;
padding: 15px;
max-width: 300px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: inset 0px 0px 10px #000;
-moz-box-shadow: inset 0px 0px 10px #000;
box-shadow: inset 0px 0px 10px #000;
border: 3px solid #666666;
z-index: 5;
}
最佳答案
尝试这样的事情:
$("#info-panel").fadeOut("fast", function() {
$(this).css("color", "red"); //Use your CSS here, I did this as an example.
}).fadeIn("fast");
关于jquery - 淡出、应用 css、淡入 - JQUERY,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16526351/