質問

私はリンクの構造と思うのjQuery/cssきを隠す <img /> タグやフェードしmouseover.

このアイデアは、HTML <img> では隠れたと思にmouseoverを円滑に効果。

一方、CSSの背景に表示されている。

HTML:

<div id="nav">

<a href="blah" id="id1">

<img src="hoverimg.png" alt="Link Text 1" /> <span> リンクテキスト1 </span> </a>

<img src="hoverimg2.png" alt="Link Text 2" /> <span> リンクテキスト2 </span> </a>

</div>

CSS:

#nav a span{
  display: none; /* Hide the text reader title */
}

#nav a {
  display: block;
  height: 200px;
  width: 250px;
  background url("bgimage.png"); /* I would ideally use the # selector for individual links.. */
}

#nav a img{
  /* what goes here so that jQuery works and so that we can backwards compatibility a:hover effect? */
}

jQuery:

???

上にのってjQueryラアニメーションを複数回の場合は対象元素の子ノードの子の数レベルの深い。があるので、停止す。

役に立ちましたか?

解決

を加えるだけで--- style="display: none;" attrイメージにhtmlとしても活用します:

       $("#nav").hover(
            function() {
                $("img", this).show();
            },
            function() {
                $("img", this).hide();
            });

(変更の影響お客様のニーズに合の表示/非表示などが必要)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top