こんにちは私のコードはうまくいきますが、#stemと#caseが上にぶら下がっているとアニメーションに含まれているのでdiv_mainGraphic上に絶対配置されます)。誰でもアイデアはありますか?ありがとう!jQuery - 例外のあるライブマウスとマウス例外
$('#div_mainGraphic').live("mouseenter mouseleave", function(event){
if (event.type == 'mouseenter') {
$('#stem').animate({"top": "-=35px"}, 500);
} else {
$('#stem').animate({"top": "+=35px"}, 150);
}
});
が働いていると私はこのような何かをやって考えていたコードです。ここ
$('#div_mainGraphic').live("mouseenter mouseleave", function(event){
if (event.type == 'mouseenter') {
$('#stem').animate({"top": "-=35px"}, 500);
}
if (event.type == 'mouseleave') {
$('#stem').animate({"top": "+=35px"}, 150);
}
if (event.location == '???') {
???
}
});
はHTMLです:
<div id="div_mainGraphic">
</div>
<img src="/images/img_stem.png" id="stem" />
<img src="/images/img_case.png" id="case" />
...しかし、私がそれはそのような何かであるべきだと思い行っています。それはあなたのために働いたのですか?どちらが最初に来るかは重要ですか? – webwrks
#stemと#caseは絶対配置された要素なので#div_mainGraphicにそれらを追加できますか?こうすることで、マウスセンターとマウスが離れると同じイベントが発生します。 – ShankarSangoli
あなたはそれらを内側に移動するか、またはそれらを#div_mainGraphicのセレクタの一部にすることを意味しますか?ありがとう – webwrks