<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>使用jQuery管理事件之事件切换</title>
<script type="text/javascript" src="jquery-2.1.0.js"></script>
<script>
$(function()
{
$("#btn1").toggle(//暂时测试失败,显隐成功
function()
{
$(this).text("第一次单击");}
,function()
{
$(this).text("第二次单击");}
);
$("div").hover(function(event)
{
$("#btn2").text("mouseover");
},
function(event)
{
$("#btn2").text("mouseout");
});
});
</script>
</head>
<body>
<button id="btn1">点击</button>
<div style="border:solid 1px red;">
<button id="btn2">状态</button>
</div>
</body>
</html>
47、实例 使用jQuery管理事件之事件切换
最新推荐文章于 2021-06-18 11:31:23 发布