我有一个网站 (lowrateadvisor.com) 我正在努力让页面顶部的可扩展 div 正常工作。我可以让它在 jsfiddle.net/3shEE/95/ 中工作,只是不在网站上。任何帮助深表感谢。
CSS
#expandable a{
color:#fff;
text-decoration:underline;
}
#expandable a:hover{
color:#fff;
text-decoration:none;
}
#expandable {
width: 100%;
height:35px;
background: transparent;
overflow: hidden;
background:#000;
color:#fff;
font-size:11px;
text-align:center;
}
#expandable.dropped {
background: #666;
color: white;
border-bottom: 1px solid #111 }
#expandable span {
display: block;
width: 100%; height: 50px;
line-height: 50px; text-align: center;
cursor: pointer;
}
#expandable ul {
width: 100%;
}
HTML
<div id="expandable">
<span> Get the lowest possible rates on pre approved home loans, mortgages and refinancing your home.</span>
<ul>
<li>We will never...<br /></li>
<li>» Ask for your SSN.</li>
<li>» Ask for a credit card.</li>
<li>» Store your information.</li>
<li>» Hassle or Pressure any applicant.</li>
<li> <a href="http://lowrateadvisor.com/apply-now/">Get Pre Approved</a> | <a href="http://lowrateadvisor.com/get-pre-approved/">Get A Quote</a></li>
</ul>
</div>
查询
$("#expandable").hover(function() {
$(this).stop().animate({"height":"200px"},1000).addClass("dropped");
}, function() {
$(this).stop().animate({"height":"35px"},1000).removeClass("dropped");
});