문서 편집 권한이 없습니다. 다음 이유를 확인해주세요: 이 문서는 이 위키의 소프트웨어 인터페이스에 쓰이는 문서로, 부정 행위를 막기 위해 보호되어 있습니다. 모든 위키에 대한 번역을 추가하거나 바꾸려면 미디어위키 지역화 프로젝트인 translatewiki.net에 참여하시기 바랍니다. 모든 방문자에게 영향을 미칠 수 있기 때문에 이 자바스크립트 문서의 편집 권한이 없습니다. 문서의 원본을 보거나 복사할 수 있습니다. // 테스트 var drawer, origin, content; function showDrawer(id, name) { origin.attr("href", "#" + id); origin.attr("data-target", id); origin.text(name); content.html($("#" + id + " > .reference-text").html()); drawer.addClass("visible"); } $(document).ready(function($) { /* create drawer */ drawer = $("<div></div>").attr("id", "reference-drawer"); origin = $("<a></a>") .attr("id", "reference-origin") .click(function() { $('html, body').animate({scrollTop: ($("#" + $(this).attr("data-target")).offset().top - 60)}, 400); }); content = $("<span></span>").attr("id", "reference-drawer-text"); drawer.append(origin); drawer.append(content); $(document.body).append(drawer); $(document).click(function(e) { if (!$(event.target).closest("#reference-drawer").length) { if ($(window).width() < 768) { drawer.removeClass("visible"); } else { drawer.animate({opacity: 0}, 100, function() { $(this).css({visibility: "hidden", width: 0, height: 0}); }); } } }).scroll(function(e) { if ("ontouchstart" in window && !$(window).width() < 768) { drawer.removeClass("visible"); } }); $(".reference a").each(function() { var span = document.createElement("span"); span.className = "reference-hooker"; span.appendChild(this.childNodes[0]); this.appendChild(span); }); $(".reference-hooker").click(function(e) { e.preventDefault(); e.stopPropagation(); showDrawer(this.parentNode.href.split("#")[1], this.textContent); if ($(window).width() < 768) { drawer.addClass("visible"); } else { drawer.css({visibility: "visible", width: "auto", height: "auto"}); drawer.css({ top: ($(this).offset().top - drawer.outerHeight()), left: $(this).offset().left }); drawer.stop().animate({opacity: 1}, 100); } }); }); 미디어위키:Gadget-ReferenceTooltips-ko.js 문서로 돌아갑니다.