次のコードでは、(see example fiddle)、緑をマウスオーバーすると2つの赤いボックスの高さは変わりますが、高さは下がります。高さを上向きにする方法はありますか?JavaScript:マウスオーバー時のCSS変更の方向を設定しますか?
CSS:
.one{
position: absolute;
left: 110px;
top: 0px;
background: green;
}
.two {
position: absolute;
left: 70px;
top: 40px;
background: red;
height: 25px;
font-size: 25px;
}
.three {
position: absolute;
left: 200px;
top: 40px;
background: red;
height: 25px;
font-size: 25px;
}
HTML:
<div class="one">15,000,000</div>
<div class="two">700</div>
<div class="three">800</div>
のjavascript:
$('.one').mouseover(function(){
$('.two, .three').css('height','50px');
}).mouseout(function(){
$('.two, .three').css('height', '25px');
});