マークされた行以外はすべて動作します。行がコメントされた行に置き換えられた場合、それは機能します。どんな助け?クリア間隔とアニメーションが機能しない
var goev = setInterval(fgoev, 2000);
function fgoev() {
$('#eventwrap').animate({
bottom: 0
}, 900).delay(5000).animate({
bottom: -10
}, 100).animate({
bottom: 0
}, 100).animate({
bottom: -10
}, 100).animate({
bottom: 0
}, 100);
}
$('#evclose').click(function() {
clearInterval(goev);
$('#eventwrap').animate({
bottom: -125
}, 900); // doesn't work
//$('#eventwrap').hide();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id='eventwrap'>
<div id='evclose'>X</div>
<a href='event.php' target='_blank' id='evinside'>
<div id='evmore'>MORE</div>
<div id='evtitleleft'>Days</div>
<div id='evtitleright'>Hours</div>
<div class='clear'></div>
<div id='evdays'>
<?php echo $diffa; ?>
</div>
<div id='evhours'>
<?php echo $diffb ?>
</div>
<div class='clear'></div>
</a>
</div>
どのように動作しませんか?アニメーションが全くない、または間違った位置にいるなどの理由があります。なぜ、明確な間隔が機能しないのですか?あなたの関数とinterval id変数に同じ名前が付いていることに気付きました。それをするのは良い考えではないかもしれません。 – xander
@xander、 'うまく行かない 'とは何も意味しません。 – bonaca
@xander、関数名を変更しました - 成功なし – bonaca