MediaWiki:Vector.js : Différence entre versions
De Sciencinfolycee
(Test de simplification) |
($ -> $j) |
||
Ligne 1 : | Ligne 1 : | ||
/* Any JavaScript here will be loaded for users using the Vector skin */ | /* Any JavaScript here will be loaded for users using the Vector skin */ | ||
− | $(document).ready(function() { | + | $j(document).ready(function() { |
// Add header links | // Add header links | ||
− | var links = $("<div id='links'><a href='http://science-info-lycee.fr/une-equipe-a-votre-service/'>Le SILO</a><span>-</span><a class='selected' href=''>Ressources</a><span>-</span><a href='http://science-info-lycee.fr/le-forum/'>Echanger</a></div>"); | + | var links = $j("<div id='links'><a href='http://science-info-lycee.fr/une-equipe-a-votre-service/'>Le SILO</a><span>-</span><a class='selected' href=''>Ressources</a><span>-</span><a href='http://science-info-lycee.fr/le-forum/'>Echanger</a></div>"); |
− | $("body").prepend(links); | + | $j("body").prepend(links); |
// Center all elements; | // Center all elements; | ||
Ligne 11 : | Ligne 11 : | ||
var width = $(window).width(); | var width = $(window).width(); | ||
var left = (width - 1100) / 2; | var left = (width - 1100) / 2; | ||
− | $("#mw-head").css("left", left + "px"); | + | $j("#mw-head").css("left", left + "px"); |
− | $("#mw-panel").css("left", left + "px"); | + | $j("#mw-panel").css("left", left + "px"); |
− | $("#content").css("left", (left + 280) + "px"); | + | $j("#content").css("left", (left + 280) + "px"); |
− | $("#content").css("height", (Math.max($("#content").height(), $("#mw-panel").height()) - 20) + "px"); | + | $j("#content").css("height", (Math.max($("#content").height(), $("#mw-panel").height()) - 20) + "px"); |
− | $("#links").css("left", (linksLeft + left) + "px"); | + | $j("#links").css("left", (linksLeft + left) + "px"); |
} | } | ||
− | $(window).resize(center); | + | $j(window).resize(center); |
center(); | center(); | ||
}); | }); |
Version du 23 novembre 2011 à 18:25
/* 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/une-equipe-a-votre-service/'>Le SILO</a><span>-</span><a class='selected' href=''>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(); });