HTMLとjQueryでdivコンテナを作成しました。ここにマウスを置くと別のパネルが上にスライドします。しかし、私はスライディングパネル "ヨーヨー"を体験しています。これは、パネルがdiv上をスライドすると、ホバー状態がトリガーされて失われ、パネルが連続して上下にポップするためです。マウスオーバー時にスライディングパネルが振動する
私が何をしたいのは、あなたがパネルが示す広場のどこにでも浮かび上がっていて、あなたが正方形にいないときはそうではありません。
ここでは、問題が何であるかを知ることができるので、このように説明するのが簡単かもしれません。
https://jsfiddle.net/xa5gtd2u/3/
また、ここでコード
HTML
<div class="container">
<div class="services-blocks">
<img class="alignnone size-full wp-image-1974" src="http://placehold.it/250x250" alt="Design" width="250" height="250" />
<h3>title here</h3>
</div>
<div class="services-slide-panel">
<h3>title here</h3>
Some text here
Some text here
Some text here
Some text here
</div>
</div>
CSS
.services-slide-panel {
background: #f3535e;
width: 100%;
position: absolute;
left: 0;
bottom: 0;
top: 0;
display: none;
color: #ffffff;
}
.services-slide-panel h3 {
color: #ffffff;
}
.services-blocks h3 {
text-align: center;
position: absolute;
bottom: 5%;
width: 100%;
color: #ffffff;
}
.container {
width: 250px;
height: 250px;
position: relative;
}
があるjQueryの
$(document).ready(function() {
$(".services-blocks").hover(function() {
$(this).next(".services-slide-panel").slideToggle("slow");
});
});
あなたは、この場合には代わりにトグルのアニメーションを試してみてください。最初のdivは2番目のdivのアニメーションをトリガーします。 2番目のdivは、ユーザーがマウスを外したときにトリガーされます。 – tintyethan
私は@ tintyethanに同意します。また、jQuery [.stop()](https://api.jquery.com/stop/)、特に '.stop(true)'を見て、繰り返しホバーしてもアニメーションを繰り返し実行させないようにしてください。 –