我的网站:实时工作示例
到目前为止,我已经实现了内容的淡出和淡入。
代码:
$(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中淡入/淡出非常不稳定,可以修复吗?
优化代码以减少代码?