jquery学习例子
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="" />
<script src="jquery.js" type="text/javascript"></script>
<title>时学宝的html文档</title>
</head>
<script type="text/javascript">
$(document).ready(function(){
$('p').mousedown(function(){//当鼠标在元素上点下时发生的事件
alert('在这里能看到效果');
});
$('a').mouseup(function(){//当鼠标在元素点下,在弹起来的时候就会调用此事件
alert('在这里看mouseup的效果');
});
$('b').mousemove(function(){//mousemove 事件通过鼠标在元素上移动来触发
alert('在这里看mousemove的效果');
});
$('s').mouseout(function(){//mouseout事件是鼠标在元素上移出的时候就调用的事件
alert('在这里看mouseout的效果');
});
$('span').mouseover(function(){//当鼠标用动到这个元素上的时候就调用其中的函数
alert('在这里看mouseover的效果');
});
});
</script>
<body>
<p>在这里能看到效果</p>
<a>在这里看mouseup的效果<a><br/>
<b>在这里看mousemove的效果</b><br/>
<s>在这里看mouseout的效果</s><br/>
<span>在这里看mouseover的效果</span>
</body>
</html>