问题#1:如何淡入文本并淡出文本,而不是仅在文本框中显示
问题 #2 [已解决]:我想在按钮图标和文本之间放置一些空格,但它不起作用。按钮示例:
更新:
padding-left: 30px;
修复了空间问题。
html:
<input type="button" id="sv" value=" Score Viewer"></input>
<input type="button" id="pv" value=" Print Viewer"></input>
<input type="button" id="ev" value=" Exam Viewer"></input>
<br>
<input type=text id="tvinfo" value="" readonly size=50 />
查询:
$(function() {
$('#sv').hover(
function () {
$('#tvinfo').val("View scores of exams already taken");
},
function () {
$('#tvinfo').val("");
}
);
$('#pv').hover(
function () {
$('#tvinfo').val("View who printed the certificate");
},
function () {
$('#tvinfo').val("");
}
);
$('#ev').hover(
function () {
$('#tvinfo').val("View who already took the exam");
},
function () {
$('#tvinfo').val("");
}
);
});
CSS:
#sv {
background: #ccc url(view.png) no-repeat top left;
height: 53px;
width: 186;
cursor: pointer;
}
#pv {
background: #ccc url(print.png) no-repeat top left;
height: 53px;
width: 186;
cursor: pointer;
}
#ev {
background: #ccc url(taken.png) no-repeat top left;
height: 53px;
width: 186;
cursor: pointer;
}