0
jQuery UI 데모 웹 페이지 중간 단계 다운 here 소스 코드의 창을 열고 닫는 "소스보기"링크의 소스 코드는 무엇입니까?jQuery UI의 데모 웹 페이지에서 "소스보기"링크의 소스 코드는 무엇입니까?
jQuery UI 데모 웹 페이지 중간 단계 다운 here 소스 코드의 창을 열고 닫는 "소스보기"링크의 소스 코드는 무엇입니까?jQuery UI의 데모 웹 페이지에서 "소스보기"링크의 소스 코드는 무엇입니까?
이 소스 DIV 숨기고 보여줍니다 자신의 스크립트에 불과 기능입니다 :
if ($('#demo-source').length == 0) {
$('<div id="demo-source"><a href="#" class="source-closed">View Source</a><div><pre><code></code></pre></div></div>').insertAfter('#demo-notes');
$('#demo-source').find("> a").click(function() {
$(this).toggleClass("source-closed").toggleClass("source-open").next().toggle();
return false;
}).end().find("> div").hide();
}
$('#demo-source code').empty().text(source);
You can view the full script here, 그것은 아약스를 통해 코드 (현재 페이지의 $.get()
을 잡고 또는 당신은 데모 링크를 클릭하면 그 중 하나를 잡고), 표시를 위해 서식을 지정한 다음 해당 함수로 전달하여 페이지의 올바른 위치에 "소스보기"div/link를 삽입합니다.