声明:我对jQuery和JavaScript比较陌生。下面的openStatement()函数在确定#statementTab尚未打开时执行。如果下面的代码没有足够的信息,只需查看下面的源代码。当我为其父元素设置动画时,为什么我的UL消失?
基本上,每当用户打开#statementTab时,包含各种选项卡的UL闪烁并消失。我想解决这个问题。
来源:http://www.cameronhermens.com/dbunkr/brochure.html
// The openStatement function opens the statement tab when the user clicks
<a id="openIt"> (if the statement tab isn't already open).
function openStatement() {
$('#explore').animate({width: '70%'}, '200');
$('#statementTab').animate({width: '213px'}, '1000');
};
// Here's the DIV.
<div id="explore" class="brochure">
<ul id="brochureTab">
<li><a href="welcome.html" >welcome</a></li>
<li><a href="ourMission.html">our mission</a></li>
<li><a href="whatIsdBunkr.html">what is dBunkr</a></li>
</ul>
</div>
<div id="statementTab">
<a id="openIt">
<img class="opaque left-5" src="images/rightArrow.jpg" height="10" width="6" alt="Expand the Statement tab">
<span class="statementBar">Statements</span>
</a>
</div>
任何控制台错误? 'animate()'把一个数字作为'speed'参数,而不是我能说的字符串。 – elclanrs