미디어위키:Common.js: 두 판 사이의 차이
둘러보기로 이동
검색으로 이동
편집 요약 없음 태그: 되돌려진 기여 |
편집 요약 없음 태그: 되돌려진 기여 |
||
| 2번째 줄: | 2번째 줄: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
// Add a toggle button to each collapsible section | // Add a toggle button to each collapsible section | ||
$('.mw-portlet. | $('.mw-portlet').each(function() { | ||
var portlet = $(this); | |||
var header = portlet.find('.pBody'); | |||
var body = portlet.find('.pBody ul'); | |||
if (body.length) { | |||
var toggleButton = $('<span class="mw-portlet-toggle">[+]</span>'); | |||
header.prepend(toggleButton); | |||
body.hide(); | |||
toggleButton.click(function() { | |||
body.slideToggle(); | |||
var text = toggleButton.text() == '[+]' ? '[−]' : '[+]'; | |||
toggleButton.text(text); | |||
}); | |||
} | |||
}); | }); | ||
}); | }); | ||
2024년 6월 25일 (화) 00:27 판
/* 이 자바스크립트 설정은 모든 문서, 모든 사용자에게 적용됩니다. */
$(document).ready(function() {
// Add a toggle button to each collapsible section
$('.mw-portlet').each(function() {
var portlet = $(this);
var header = portlet.find('.pBody');
var body = portlet.find('.pBody ul');
if (body.length) {
var toggleButton = $('<span class="mw-portlet-toggle">[+]</span>');
header.prepend(toggleButton);
body.hide();
toggleButton.click(function() {
body.slideToggle();
var text = toggleButton.text() == '[+]' ? '[−]' : '[+]';
toggleButton.text(text);
});
}
});
});