4つのdivがあります。すべて背景画像を持っているので、div1の上にマウスを置くと、スクリプトはdiv2,3,4の背景画像を変更する必要があります。これはアニメーション化(フェードイン?)する必要があります。fadein cssホバリングの変更
これはjqueryの「時間を経て学習した後のコード」ですが、jqueryでアニメーション化することはできませんでした。
HTML:
<div class="categories" style="color:#ccc;">
<div class="single_cat first"></div>
<div class="single_cat second"></div>
<div class="single_cat third"></div>
<div class="single_cat fourth"></div>
</div>
CSS:
#tour .categories{
width: 950px;
height: 236px;
background-color: #efefef;
margin: 20px 0 0 0;
}
.single_cat {
width: 236px;
height: inherit;
margin: 0 2px 0 0;
float: left;
background-color: #222;
color: #fff;
}
.single_cat.fourth {
width: 236px;
height: inherit;
margin: 0;
float: left;
background-color: #222;
}
.single_cat.first {
background-image:url('/img/takethetour/r_text.png');
}
.single_cat.second {
background-image:url('/img/takethetour/b_text.png');
}
.single_cat.third {
background-image:url('/img/takethetour/c_text.png');
}
.single_cat.fourth {
background-image:url('/img/takethetour/bou_text.png');
}
jqueryの(Javaの):
$(".first").mouseover(function() {
$(".second").css('background', 'url(/img/takethetour/r_2.png)');
$(".third").css('background', 'url(/img/takethetour/r_3.png)');
$(".fourth").css('background', 'url(/img/takethetour/r_4.png)');
}).mouseout(function(){
$(".second").css('background', 'url(/img/takethetour/b_text.png)');
$(".third").css('background', 'url(/img/takethetour/c_text.png)');
$(".fourth").css('background', 'url(/img/takethetour/bou_text.png)');
});
$(".second").mouseover(function() {
$(".first").css('background', 'url(/img/takethetour/b_2.png)');
$(".third").css('background', 'url(/img/takethetour/b_3.png)');
$(".fourth").css('background', 'url(/img/takethetour/b_4.png)');
}).mouseout(function(){
$(".first").css('background', 'url(/img/takethetour/r_text.png)');
$(".third").css('background', 'url(/img/takethetour/c_text.png)');
$(".fourth").css('background', 'url(/img/takethetour/bou_text.png)');
});
$(".third").mouseover(function() {
$(".first").css('background', 'url(/img/takethetour/c_2.png)');
$(".second").css('background', 'url(/img/takethetour/c_3.png)');
$(".fourth").css('background', 'url(/img/takethetour/c_4.png)');
}).mouseout(function(){
$(".first").css('background', 'url(/img/takethetour/r_text.png)');
$(".second").css('background', 'url(/img/takethetour/b_text.png)');
$(".fourth").css('background', 'url(/img/takethetour/bou_text.png)');
});
$(".fourth").mouseover(function() {
$(".first").css('background', 'url(/img/takethetour/bou_2.png)');
$(".third").css('background', 'url(/img/takethetour/bou_3.png)');
$(".second").css('background', 'url(/img/takethetour/bou_4.png)');
}).mouseout(function(){
$(".first").css('background', 'url(/img/takethetour/r_text.png)');
$(".third").css('background', 'url(/img/takethetour/c_text.png)');
$(".second").css('background', 'url(/img/takethetour/b_text.png)');
});
この情報をお寄せいただきありがとうございます。 –