jQuery Animation - 如何將焦點應(yīng)用于按鈕,而不調(diào)用按鈕的onFocus事件處理程序...
我們想知道如何將焦點應(yīng)用于按鈕,而不調(diào)用按鈕的onFocus事件處理程序。...
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<style type='text/css'>
#test {
width: 150px;
height: 150px;
background-color: red;
opacity: 0;
}
</style>
<script type='text/javascript'>
$(window).load(function(){
$('a').click(function() {
$('#test').fadeTo('slow', 1);
});
});
</script>
</head>
<body>
<div id="test"></div>
<a href="#">click</a>
</body>
</html>
The code above is rendered as follows: