编辑:我已经得到了一个叉子,可以使用两个代码括号将 CSS 正确分配给 DOM,但是它不再居中在父 div 内。有任何想法吗?
查询:
$("#container").hover(function () {
$("#innerFocusPrompt").position({
my: "center center",
at: "center center",
of: "#container"
});
$("#innerFocusPrompt").css({
"display": "inherit"
}).fadeIn(100);
});
CSS:
#container {
background-color: black;
color: #121212;
height:400px;
width:400px;
margin: 0 auto;
margin-top: 50px;
}
#innerFocusPrompt {
display: none;
background-color: red;
color: black;
height:100px;
width:100px;
}