창 클릭, 공백 숨기기 (stop Propagation)

7232 단어 Propagation
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<script>
$(
function () {
$(
"#hTest").click(function (ev) {

// aTest
$("#aTest").trigger("click");
ev.stopPropagation();
});
$(
"#aTest").click(function (ev) {
$(
"#PHide").show(300);

//
ev.stopPropagation();



$(document).one(
"click", function () {
$(
"#PHide").hide(300);
});

});


});
</script>
<h2>
ASP.NET!
</h2>
<div id="hTest">
<p>
ASP.NET ,
<a id="aTest">www.asp.net/cn</a>
</p>
<p id="PHide" style="display: none">
<a>MSDN ASP.NET </a>
</p>
</div>
</asp:Content>

좋은 웹페이지 즐겨찾기