mthoutai

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>设计器</title>
	<script name="systemJs" type="text/javascript" src="../../zhuant-design/js/jquery-1.11.3.min.js"></script>
</head>
<body>
	<button id="old">.trigger("focus")</button>
    <button id="new">.triggerHandler("focus")</button><br/><br/>
    <input type="text" value="To Be Focused"/>
	
	<br>
	<span id="content">这是内容</span>
    <ul>
	    <li>test1</li>
		<li>test1</li>
		<li>test1</li>
	</ul>
	
	
	<script type="text/javascript">
		$("#old").click(function(){
		  $("input").trigger("focus");
		});
		$("#new").click(function(){
		  $("input").triggerHandler("focus");
		});
		$("input").focus(function(){
		  $("<span>Focused!</span>").appendTo("body").fadeOut(1000);
		});
		
		
		$("li").click(function(){
		    $("#content").triggerHandler("getContent");
		});
		$("#content").bind("getContent",function(){
		     alert($(this).text());
		});
	</script>
</body>
</html>

posted on 2017-08-04 17:46  mthoutai  阅读(149)  评论(0编辑  收藏  举报