js或者jquery動態更改a標簽的linkhovervisitedactive不同的變換?
代碼示例:
$(document).ready(function(){
$("#ceshia").mouseover(function(){
var underline=$("#underline").val();
if(underline==1 ||underline==2) {
var xia="underline";
}
else {
var xia="none";
}
var hover=$("#hover").val();
$("#ceshia:hover").css({
"color":hover,"text-decoration":xia
}
);
}
);
$("#ceshia").mouseout(function(){
var underline=$("#underline").val();
if(underline==0 ||underline==2) {
var xia="none";
}
else {
var xia="underline";
}
var links=$("#link").val();
$("#ceshia:link").css({
"color":links,"text-decoration":xia
}
);
}
);
$("#ceshia").mousedown(function(){
var underline=$("#underline").val();
if(underline==0 ||underline==2) {
var xia="none";
}
else {
var xia="underline";
}
var active=$("#visited").val();
$("#ceshia:active").css({
"color":active,"text-decoration":xia
}
);
}
);
}
);