2015.11.16JQuery 隐藏,显示按钮.

<!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" />
<title>无标题文档</title>
<script type="application/javascript" src="jquery-1.11.3.min.js"></script>

<script type="application/javascript">

$(document).ready(function(e) {
    //$('#hide').ready(function(){$("p").hide();});
    //$('#hide').click(function(){$("p").hide();});
    //$('#show').click(function(){$('p').show();});
    //$('#show').click(function(){$('div').show();});

});


</script>
</head>

<body>

<p>显示的内容</p>

<p class="wz">显示的内容2</p>

<div class="wz">div显示</div>


<input id="show" onclick="$(this).click($('.wz').show())" type="button" value="显示" />

<input id="hide" onclick="$(this).click($('.wz').fadeToggle(2000))" type="button" value="隐藏" />

<input id="hide" onclick="$(this).click($(this).fadeToggle(2000))" type="button" value="隐藏" />



</body>
</html>

 

posted on 2015-11-16 23:42  锿咚公爵  阅读(125)  评论(0编辑  收藏  举报