미디어 위키 스킨을 만들 때 메인 페이지 컨텐츠 영역 바깥에 사이드 바에 목차를 두는 방법은 무엇입니까?사용자 정의 미디어 위키 스킨의 기본 페이지 컨텐츠 영역 외부에서 목차를 삽입하려면 어떻게해야합니까?
2
A
답변
1
먼저
https://www.mediawiki.org/wiki/Extension:NoTOC가 그럼 난 당신이 원하는 목차를 만들, 당신의 피부에 Parser::formatHeadings의 관련 부분을 복사 제안 참조 TOC가 인쇄되어 있지 않은지 확인하십시오.
그러나 실제로 모든 사용자가 기사 외부에 표시해야하는 경우가 아니라면 Javascript를 사용하여 원하는 위치로 #toc를 이동하는 것이 훨씬 쉬울 것이라고 생각합니다.
0
사용자가 스크롤 위치에 관계없이 목차를 계속 사용할 수있게하려면 CSS 속성 position: fixed
을 사용할 수 있습니다 (기본 벡터 스킨이있는 MW 1.24.4에서 다음 기능이 작동합니다. MonoBook, Modern 및 Cologne Blue 스킨 포함) :
#toc {
position: fixed;
right: 0;
top: 7em; /* 5em is height of header, 6em brings just under */
/* bottom: 5em; /* 5em puts us above the footer; not bad but too low when TOC is collapsed */
z-index: 10000; /* Ensure we float above the header, etc. */
/* Add opacity (translucency) */
background-color: rgb(249, 249, 249);
background-color: rgba(249, 249, 249, 0.9); /* Higher opacity (last arg) means less transparency */
}
/* Ensure the TOC height doesn't take over the screen; percentages may be higher than view port, so we use pixels */
#toc > ul {
max-height: 350px;
overflow: auto;
}