2013-10-25 16 views

回答

1

首先確保的TOC沒有打印出來,看到https://www.mediawiki.org/wiki/Extension:NoTOC

那我就建議你的Parser::formatHeadings相關部分複製到你的皮膚,創造您想要的位置一個TOC。但是,除非你真的需要它出現在所有用戶的文章之外,否則我認爲使用Javascript將#toc移動到你想要的地方會容易得多。

0

如果你想要的目錄表是在一邊,但仍然可用,無論用戶的滾動位置,你可以使用CSS屬性position: fixed(以下爲我工作MW 1.24.4使用默認的矢量皮膚,以及內置的MonoBook,Modern和科隆藍色皮膚):

#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; 
} 
相關問題