Open main menu

ITSTEP β

MediaWiki:Common.js

Revision as of 14:48, 31 March 2017 by Kustov (talk | contribs)

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* Размещённый здесь код JavaScript будет загружаться пользователям при обращении к каждой странице */


<script>
$(document).ready(function() {
 
$('body').append('<div class="button-up" style="display: none;opacity: 0.7;width: 100px;height:100%;position: fixed;left: 0px;top: 0px;cursor: pointer;text-align: center;line-height: 100px;color: #45688E;">^ Наверх</div>');
 
$ (window).scroll (function () {
if ($ (this).scrollTop () > 300) {
$ ('.button-up').fadeIn();
} else {
$ ('.button-up').fadeOut();
}
});
 
$('.button-up').click(function(){
$('body,html').animate({
scrollTop: 0
}, 100);
return false;
});
 
$('.button-up').hover(function() {
$(this).animate({
'opacity':'1',
}).css({'background-color':'#E1E7ED','color':'#45688E'});
}, function(){
$(this).animate({
'opacity':'0.7'
}).css({'background':'none','color':'#45688E'});;
});
 
});
</script>