我不知道你会不会jquery,会的话很轻松实现
我用js给你写了个大概,你研究下
<html>
<head><style>
#aaa{ width:200px; background:#FF0000; border-color:#99FF00; border:5px solid;
}</style>
<script>
function cs(backBG,borderBG){
oldBody=document.body;
with(oldBody){
var newBody=cloneNode();
style.filter='blendtrans(duration=1)';
filters[0].apply();
with(document.styleSheets[0]){
rules[0].style.backgroundColor=backBG;
rules[0].style.borderColor=borderBG;
}
filters[0].play();
setTimeout(function(){
if(oldBody!=null){
oldBody.applyElement(newBody, "inside")
oldBody.swapNode(newBody);
oldBody.removeNode(true);
}
},1500);
}
}
</script>
</head>
<body>
<div id="aaa" οnmοuseοver="cs('skyblue','blue')"></div>
</body>
</html>
这不过是事件改变下,这是基础知识,应该知道
转载于:https://www.cnblogs.com/zhoujianwen/archive/2013/05/03/3057382.html