我试图让一个跨度出现在 JQuery 上mouseOver
或悬停在 JQuery 上。我希望发生的是,当我将鼠标悬停在 上时box1
,"sale"
应该会出现。它不起作用,有人可以帮忙吗?
HTML:
<div id="columnOne">
<span id="sale">for sale</span>
<div id="box1"></div>
<div id="box2"></div>
</div>
CSS:
#sale{width: 85px;
margin: 0 0 -45px 15px;
padding: 5px;
position: relative;
display: none;
font-size: 14pt;
font-family: 'oxygen', serif;
background-color: #000;
color: #fff;
text-transform: uppercase;
-webkit-border-radius: 5px 5px;
-moz-border-radius: 5px 5px;
border-radius: 5px 5px;}
#box1{width: 240px;
height: 220px;
margin: 10px;
position: relative;
display: block;
background-color: #4174a8;
background-image: url(../images/crown.png);
background-repeat: no-repeat;
background-position: center;
z-index: -1;}
查询:
$(document).ready(function(){
$('#boxt1').hover(function(){
$('#sale').mouseOver('fast');
});
});