ça fait plusieurs fois qu'on me le réclame alors le voici le voilà...
Vous avez un rendu visuel sur
le blog de Silo, c'est exactement le même modèle.
Attention : Le menu fonctionne sous IE 7 et sous firefox. Avec IE 6 ça merdoie ;-)
Pour installer le menu celà se fait en deux temps :
1- Dans la feuille de style, "modifier le template"
vous collez le code suivant tout en bas de la page
/*--------- Menu horizontal -----------*/
#nav,
#nav ul {padding:0 0 5px 0; margin:0; list-style:none; font: 15px Tahoma, Arial, Helvetica, sans-serif; border:0px solid #000; border-color:#000; border-width:0px 0px 0px 0px; background:#CCC;
position:relative; z-index:200;}
#nav {height:30px; width: 1000px; padding:0;}
#nav li {float:left;}
#nav li li {float:left;}
/* a hack for IE5.x and IE6 */
* html #nav li li {float:left;}
#nav li a {display:block; float:center; color:#FFFFFF; border-right:0px solid #000; border-color:#000; margin:0 10px 0 10px; height:30px; line-height:30px; text-decoration:none;
white-space:nowrap;}
#nav li li a {height:20px; line-height:20px; float:none;}
#nav li:hover {position:relative; z-index:300;}
#nav li:hover ul {left:0; top:22px;}
/* another hack for IE5.5 and IE6 */
* html #nav li:hover ul {left:10px;}
#nav ul {position:absolute; left:-9999px; top:-9999px;}
/* yet another hack for IE5.x and IE6 */
* html #nav ul {width:1px;}
/* it could have been this simple if all browsers understood */
/* show next level */
#nav li:hover li:hover > ul {left:-15px; margin-left:100%; top:-1px;}
/* keep further levels hidden */
#nav li:hover > ul ul {position:absolute; left:-9999px; top:-9999px; width:auto;}
/* show path followed */
#nav li:hover > a {text-decoration:underline; color:#fff;}
/* but IE5.x and IE6 need this lot to style the flyouts and path followed */
/* show next level */
#nav li:hover li:hover ul,
#nav li:hover li:hover li:hover ul,
#nav li:hover li:hover li:hover li:hover ul,
#nav li:hover li:hover li:hover li:hover li:hover ul
{left:0px; margin-left:100%; top:5px;}
/* keep further levels hidden */
#nav li:hover ul ul,
#nav li:hover li:hover ul ul,
#nav li:hover li:hover li:hover ul ul,
#nav li:hover li:hover li:hover li:hover ul ul
{position:absolute; left:-9999px; top:-9999px;}
/* show path followed */
#nav li:hover a,
#nav li:hover li:hover a,
#nav li:hover li:hover li:hover a,
#nav li:hover li:hover li:hover li:hover a,
#nav li:hover li:hover li:hover li:hover li:hover a,
#nav li:hover li:hover li:hover li:hover li:hover li:hover a
{text-decoration:none; color:#999;} /* Hover sur les liens */
/* hide futher possible paths */
#nav li:hover li a,
#nav li:hover li:hover li a,
#nav li:hover li:hover li:hover li a,
#nav li:hover li:hover li:hover li:hover li a,
#nav li:hover li:hover li:hover li:hover li:hover li a
{text-decoration:none; color:#fff;} /* Les liens */
A vous de jouer avec les différents codes couleurs pour avoir le rendu que vous voulez...
2 - Dans la page d'accueil, page des archives, page à propos... (partout où on a un header et une bannière finalement)
APRES ces lignes
<div id="banner">
<div class="banner-decorator1">
<div
class="banner-decorator2">
<h1><a href="{$blog.url}">{$blog.title}</a></h1>
<h2>{$blog.description|default:" "}</h2>
</div>
</div>
</div>
Vous collez le code suivant :
<!-- menu -->
{literal}
<script type="text/javascript">
stuHover = function() {
var cssRule;
var newSelector;
for (var i = 0; i < document.styleSheets.length; i++)
for (var x = 0; x < document.styleSheets[i].rules.length ; x++)
{
cssRule = document.styleSheets[i].rules[x];
if (cssRule.selectorText.indexOf("LI:hover") != -1)
{
newSelector = cssRule.selectorText.replace(/LI:hover/gi, "LI.iehover");
document.styleSheets[i].addRule(newSelector , cssRule.style.cssText);
}
}
var getElm = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<getElm.length; i++) {
getElm[i].onmouseover=function() {
this.className+=" iehover";
}
getElm[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" iehoverb"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", stuHover);
</script>
{/literal}
<ul id="nav"><center>
<li><a href="
http://votreblog.hautetfort.com/">
Accueil </a></li>
<li><a href="
http://votreblog.hautetfort.com/index.php?page=contact&lg=1">
Contact </a></li>
<li><a href="#nogo">
Exemple avec sous menus</a>
<ul>
<li><a href="
http://votreblog.hautetfort.com/">
sous menus 1</a></li>
<li><a href="
http://votreblog.hautetfort.com/">
sous menus 2</a></li>
<li><a href="
http://votreblog.hautetfort.com/">
sous menus 3</a></li>
</ul></li>
<li><a href="
http://votreblog.hautetfort.com/archives/">Archives </a></li>
</ul>
<!-- /menu -->
Voilà à vous de personnaliser le nom de vos cellules et l'adresse des vos URL