/*
| Script copies action tabs below the page content.
| Works with skin-vector & skin-monobook.
|
| Author: ]
| Licence: CC-BY-SA 3.0
| Version: 2.0.0
| Credits: ] - for idea and ver. 1.0.3
] - for help
\* ----------------------------------------------------- */
$(document).ready(function() {
if ( $('body').hasClass('skin-vector') ) {
var mwHead = $('#mw-head');
mwHead.css('height',mwHead.outerHeight())
$('#mw-head h3, #mw-head h5').css({margin: 0});
var navR = $('#right-navigation');
var navL = $('#left-navigation');
var tabs2 = $('<div id="tabs2"><br style="clear: both; background-color: white"></div>');
tabs2.insertAfter('#bodyContent');
$(window).scroll(function(){
if ( mwHead.offset().top + mwHead.height() < $(window).scrollTop() ) {
navR.css({marginTop: 0});
navR.prependTo(tabs2);
navL.css({position: 'inherit'});
navL.prependTo(tabs2);
} else {
navL.css({position: 'absolute'});
navL.appendTo(mwHead);
navR.css({marginTop: ''});
navR.appendTo(mwHead);
}
});
} else if ( $('body').hasClass('skin-monobook') ) {
var content = $('#content');
var nav = $('#p-cactions');
var menu = $('#column-one h2:first-child');
$(window).scroll(function(){
if ( content.offset().top < $(window).scrollTop() ) {
nav.css({position: 'relative', top: 0});
nav.insertAfter(content);
} else {
nav.css({position: 'absolute', top: '1.3em'});
nav.insertAfter(menu);
}
});
}
});