私のウェブサイト: Live Working Example
ここまでコンテンツのフェードアウトとフェードインを実現してきました。
コード:
$(document).ready(function(){
$('.clinical').click(function (event){
$("#cl").fadeIn();
$("#nc").fadeOut();
$("#bth").fadeOut();
});
$('.nonclinical').click(function (event){
$("#cl").fadeOut();
$("#nc").fadeIn();
$("#bth").fadeOut();
});
$('.both').click(function (event){
$("#cl").fadeOut();
$("#nc").fadeOut();
$("#bth").fadeIn();
});
});
誰かが支援できる場合は、次のことについて支援が必要です。
- デフォルトではクリニカルテキストが表示されるので、クリニカルボタンを押した状態にして他のボタンと区別したい。
#1 の CSS コード:
#demo {
margin: 0px auto;
display: block; /* Change anchor to block element */
width: 275px; height: 47px; /* Specify width and height of the image. Height is value of each individual button graphic */
background-image: url(testBtn.png); /* Add the image as a background */
background-position: top; /* Set the position to the top */
text-align: center;
vertical-align: middle;
line-height: 47px; /* the same as your div height */
font-size: 24px;
font-weight: bold;
font-style: italic;
color: #5E5E5E;
}
#demo:hover {
background-position: center; /* Set the position to the center */
}
#demo:active {
background-position: bottom; /* Set the position to the bottom */
color: #ffffff;
}
#nc {
display: none;
}
#bth {
display: none;
}
ユーザーがどのボタンをクリックしても、コンテンツがフェードインし (機能している)、ボタンが押された状態になります。
IE でフェードイン/フェードアウトが非常に不安定です。修正できますか?
コードを最適化してコードを少なくしますか?