스크립트 관리자와 Javascript/Jquery가 추가 된 마스터 페이지가 있습니다. 아래를 참조사용자 정의 jQuery div 표시/숨기기 JS가 ASP.Net에서 작동하지 않습니다.
<asp:ScriptManager ID="SM" runat="server" EnablePartialRendering="true">
<Scripts>
<asp:ScriptReference Path="~/Scripts/jquery-1.7.2.min.js" ScriptMode="Release" />
<asp:ScriptReference Path="~/Scripts/Custom.js" ScriptMode="Release" />
</Scripts>
</asp:ScriptManager>
사용자 정의 JS를 :
$(".section").click(function() {
if ($(this).next(".sectiondetail").is(":hidden")) {
$(this).next(".sectiondetail").slideDown("slow");
$(this).children('span').text('[-]');
} else {
$(this).next(".sectiondetail").slideUp("slow");
$(this).children('span').text('[+]');
}
});
내가 배치 한 내 마스터 페이지를 사용하여 콘텐츠를 페이지에 추가되어 내 ASCX 컨트롤의 HTML 다음
<div class="section">
<span>[+]</span> General Information
</div>
<div class="sectiondetail" style="display: none;">
Details go here.
</div>
JS 함수가 예상대로 작동하지 않습니다. 내 ASCX 컨트롤 페이지에서 JS 함수를 추가하면 예상대로 작동합니다. 여기서 뭐가 잘못 됐니?
감사합니다.
(), 기능 ('클릭'{...}) $로 시도 살고 –