Yes it is working but it is changing the color permanently i just want a flash... – user2217267
Snook有一個用CSS3做這個的很好的例子。這是一個工作示例,改編自該頁面:我這樣做,使用
document.getElementById(id).style.outline = 'red solid 3px';
這個工程有一個大綱(如文本域)的所有元素
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style type="text/css" media="all">
:target {
-webkit-animation: target-fade 3s 1;
-moz-animation: target-fade 3s 1;
}
@-webkit-keyframes target-fade {
0% { background-color: rgba(0,0,0,.1); }
100% { background-color: rgba(0,0,0,0); }
}
@-moz-keyframes target-fade {
0% { background-color: rgba(0,0,0,.1); }
100% { background-color: rgba(0,0,0,0); }
}
</style>
</head>
<body>
<p>Click the link to <a href="#goal">target the div</a>.
<div id="goal">This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. This is the div. </div>
</body>
</html>
什麼是'.effect()'方法? – 2013-04-30 12:13:02
是的,我知道這是錯誤的....我嘗試了一些我在網上發現的... – 2013-04-30 12:14:40
@ArtyomNeustroev我猜這是http://jqueryui.com/effect/ – 2013-04-30 12:14:41