0
私はnavbarの事をhereの下に行っています。JQueryを使用してナビバーの複数の画像を置き換える
基本的にユーザーが画像の上を移動すると、ファイル名がxyz.pngからxyz-hover.pngに変更され、新しい画像が表示されます。クールなフェードで。
例外を除いて、ホバーオーバーされたすべての画像は同じ画像に変化します。
誰もがこのことを知っていますか?
<script type="text/javascript">
$(document).ready(function() {
// Change the image of hoverable images
var openPng = $(".fadeim").attr("src");
var closedPng = openPng.replace(".png", "-hover.png");
$(".fadeim").hover(function() {
$(this).stop(true, true).fadeOut(700, function() {
$(this).attr("src", closedPng).fadeIn(700);
});
}, function() {
$(this).stop(true, true).fadeOut(700, function() {
$(this).attr("src", openPng).fadeIn(700);
});
});
});
</script>
私はあなたに私のキャップを渡します。今では不可能だったように見えるものは今では機能します。ありがとうございます。 –