Home › Forum › Problemi Vari con WP › 4 Livelli per un drop down menu
-
AutorePost
-
-
25 Febbraio 2009 alle 21:50 #9611MariposalibrePartecipante
Ciao,
Ho proprio bisogno di una mano!
Cerco un modo di far venir fuori un menu a discesa a 4 livelli (max 5 quindi dinamico). sulle categorie sono arrivata a 3 (con un piccolo aiuto) ma nn bastano purtroppo ed è un vero problema.
Potrei farlo anche sulle pagine al posto delle categorie basta che ci riesca.
Qualcuno mi ha detto che non è possibile nè con le categorie nè con le pagine, ma è vero??
Tenendo presente che nn posso farlo lato codice perchè collaboro a distanza con persone che di codice nn capiscono nulla (per la verità meno di me nemmeno io sono una cima! ) ho bisogno che una funzione lo realizzi per me. Ho visto che wp accetta il 4 livello sulle pagine ma nn so come fare per mostrarlo.
Ho provato decine di plugin senza successo.
Uso un file js che come impostazione del menu ha questo:
// No conflict with JS libraries
jQuery.noConflict();
jQuery(document).ready(function() {
// Drop Down Menu (2 Levels)
jQuery(‘#menu ul’).hide(0.000000000000000000000000000000000000001);
jQuery(‘#menu li a’).addClass(‘nav_parent’);
jQuery(‘#menu ul a’).removeClass(‘nav_parent’);
jQuery(‘#menu ul a’).addClass(‘nav_child’);
jQuery(‘.nav_parent’).bind(‘mouseenter’, function() {
if ((jQuery(this).next().is(‘ul’)) && (jQuery(this).next().is(‘:visible’))) {
return false;
} else if ((jQuery(this).next().is(‘ul’)) && (jQuery(this).next().is(‘:hidden’))) {
jQuery(this).addClass(‘selected’);
jQuery(this).append(‘<div class=”arrow”></div>’);
jQuery(this).next().show();
return false;
}
});
jQuery(‘.nav_parent’).parent().bind(‘mouseleave’, function() {
jQuery(‘#menu li a’).removeClass(‘selected’);
jQuery(‘.arrow’).remove();
jQuery(‘#menu ul:visible’).hide();
});
jQuery(‘#menu ul a’).bind(‘mouseenter’, function() {
if ((jQuery(this).next().is(‘ul’)) && (jQuery(this).next().is(‘:visible’))) {
return false;
} else if ((jQuery(this).next().is(‘ul’)) && (jQuery(this).next().is(‘:hidden’))) {
jQuery(this).next().show();
return false;
}
});
jQuery(‘#menu ul a’).bind(‘mouseleave’, function() {
jQuery(this).next().hide();
});
jQuery(‘#menu ul ul’).bind(‘mouseenter’, function() {
jQuery(this).show();
jQuery(this).event.stopPropagation();
});
jQuery(‘#menu ul ul’).bind(‘mouseleave’, function() {
jQuery(this).hide();
});
// End of Menu
Il css del menu è attualmente a:
/* Sub Menu Stylesheet */
#menu ul {
display: none;
position: absolute;
z-index: 999;
top: 24px;
left: -1px;
background: #fff;
padding: 10px 5px 10px 5px;
border: 1px solid #cdd8e0;
border-top: 0;
height: auto;
width: 190px;
}
#menu ul li a {position: relative}
#menu ul ul {
display: none;
position: absolute;
z-index: 999;
top: -11px;
left: 195px;
background: #fff;
padding: 10px 5px 10px 5px;
border: 1px solid #cdd8e0;
border-top: 0;
height: auto;
width: 190px;
}
#menu ul li {
float: none;
display: block;
border-right: 0;
position: relative;
}
#menu ul li a {
float: none;
display: block;
font-weight: bold;
color: #ff6600;
padding: 0 5px 0 5px;
height: 22px;
line-height: 22px;
border-top: 1px solid #eee;
}
#menu ul li a:hover, #menu ul li a.selected, #menu ul li a.selected:hover {
background: #f6f6f6;
color: #CC3399;
}
La navigazione delle pagine in header è scitta cosà¬:
<?php wp_list_pages(‘sort_column=menu_order&sort_order=ASC&depth=4&title_li=’); ?>
Mentre quella delle categorie cosà¬:
<?php wp_list_categories(‘orderby=name&order=ASC&depth=4&hide_empty=0&title_li=&exclude=’.$mytheme); ?>
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.