MediaWiki:Common.js — различия между версиями
Материал из doc.abonent.plus
Строка 12: | Строка 12: | ||
} | } | ||
}); | }); | ||
+ | |||
+ | <a href="#top" title="Наверх" class="topbutton">^Наверх</a> | ||
+ | |||
+ | .topbutton { | ||
+ | width:100px; | ||
+ | border:2px solid #ccc; | ||
+ | background:#f7f7f7; | ||
+ | text-align:center; | ||
+ | padding:10px; | ||
+ | position:fixed; | ||
+ | bottom:50px; | ||
+ | right:50px; | ||
+ | cursor:pointer; | ||
+ | color:#333; | ||
+ | font-family:verdana; | ||
+ | font-size:12px; | ||
+ | border-radius: 5px; | ||
+ | -moz-border-radius: 5px; | ||
+ | -webkit-border-radius: 5px; | ||
+ | -khtml-border-radius: 5px; | ||
+ | } |
Версия 10:35, 16 ноября 2016
addOnloadHook(function() {
var elems = document.getElementsByClassName('editsection');
for (i = 0; i < elems.length; i++) {
var span = document.createElement('span');
var link = document.createElement('a');
link.href = '#top';
link.appendChild(document.createTextNode('back to top'));
span.appendChild(document.createTextNode('['));
span.appendChild(link);
span.appendChild(document.createTextNode('] '));
elems[i].insertBefore(span, elems[i].firstChild);
}
});
<a href="#top" title="Наверх" class="topbutton">^Наверх</a>
.topbutton {
width:100px;
border:2px solid #ccc;
background:#f7f7f7;
text-align:center;
padding:10px;
position:fixed;
bottom:50px;
right:50px;
cursor:pointer;
color:#333;
font-family:verdana;
font-size:12px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-khtml-border-radius: 5px;
}