MediaWiki:Vector.js : Différence entre versions
De Sciencinfolycee
(Lien "Ressources" corrigé) |
(Modification du lien "SILO" + patch affichage menu) |
||
Ligne 3 : | Ligne 3 : | ||
$j(document).ready(function() { | $j(document).ready(function() { | ||
// Add header links | // Add header links | ||
− | var links = $j("<div id='links'><a href='http://science-info-lycee.fr | + | var links = $j("<div id='links'><a href='http://science-info-lycee.fr'>Le SILO</a><span>-</span><a class='selected' href='http://wiki.inria.fr/sciencinfolycee/Accueil'>Ressources</a><span>-</span><a href='http://science-info-lycee.fr/le-forum/'>Echanger</a></div>"); |
$j("body").prepend(links); | $j("body").prepend(links); | ||
Ligne 20 : | Ligne 20 : | ||
center(); | center(); | ||
− | // Remove the menu p- | + | // Remove the menu p-Retour_vers if Javascript does work |
− | $j("#p- | + | $j("#p-Retour_vers").remove(); |
}); | }); |
Version du 9 février 2012 à 14:33
/* Any JavaScript here will be loaded for users using the Vector skin */ $j(document).ready(function() { // Add header links var links = $j("<div id='links'><a href='http://science-info-lycee.fr'>Le SILO</a><span>-</span><a class='selected' href='http://wiki.inria.fr/sciencinfolycee/Accueil'>Ressources</a><span>-</span><a href='http://science-info-lycee.fr/le-forum/'>Echanger</a></div>"); $j("body").prepend(links); // Center all elements; var linksLeft = parseInt($("#links").css("left")); var center = function() { var width = $(window).width(); var left = (width - 1100) / 2; $j("#mw-head").css("left", left + "px"); $j("#mw-panel").css("left", left + "px"); $j("#content").css("left", (left + 280) + "px"); $j("#content").css("height", (Math.max($("#content").height(), $("#mw-panel").height()) - 20) + "px"); $j("#links").css("left", (linksLeft + left) + "px"); } $j(window).resize(center); center(); // Remove the menu p-Retour_vers if Javascript does work $j("#p-Retour_vers").remove(); });