MediaWiki-目录悬浮+隐藏

来自ling
跳转至: 导航搜索
  • 进入index.php/MediaWiki:Common.css
  • 输入如下内容
/* 放置于这里的CSS将应用于所有皮肤 */
#toc{
 display: block;
 position: fixed;
 top: 100px;
 right: 0px;
 min-width: 100px;
 max-width: 350px;
 max-height: 20px;
 overflow-y: scroll;
 border: 1px solid #aaa;
 border-radius: 0 0 1px 1px;
 -moz-border-radius: 0 0 1px 1px;
 background: rgba(249,249,249,0.75);
 padding: 12px;
 box-shadow: 0 1px 8px #000;
 -webkit-box-shadow: 0 1px 8px #000;
 -moz-box-shadow: 0 1px 8px #000;
}
 
#toc:hover{
 display: block;
 position: fixed;
 top: 100px;
 right: 0px;
 min-width: 100px;
 max-width: 350px;
 max-height: 500px;
 overflow-y: scroll;
 border: 1px solid #aaa;
 border-radius: 0 0 1px 1px;
 -moz-border-radius: 0 0 1px 1px;
 background: rgba(249,249,249,0.75);
 padding: 12px;
 box-shadow: 0 1px 8px #000;
 -webkit-box-shadow: 0 1px 8px #000;
 -moz-box-shadow: 0 1px 8px #000;
 
}
/* == 浮动目录 == */
#toc.mbox-image { display: none; }
table.toc {
        position: fixed;
        top: 100px;
        right: 0px;
        border: 0px;
        width: 300px;
        border-bottom: 1px SOLID #CCC;
        border-left: 1px SOLID #CCC;
}
table.toc tbody tr td ul {
        overflow: auto;
        max-height: 400px;
}
 
table.toc tbody tr td ul ul {
        overflow: auto;
        max-height: 10000px;
}
 
body { overflow-x: hidden;}