Superfish второго уровня ul очень крошечный

0

Проблема заключается в меню суперфиша на моем веб-сайте: http://alexander-pastor.de/

При наведении указателя мыши на li верхнего уровня ul, дочерняя ul имеет только высоту 16px. Я не могу это исправить. Добавление css-свойства height/min-height в ul или li не работает.

Я добавил sf-меню класса в ul через jQuery, потому что это автогенерированный код из contao-модуля. Он завернут навигационным элементом. Как это:

<nav class="mod_navigation block">
    <ul class="level_1 sf-menu">
        <li>
           <ul>...
        </li>
        ... ...
        ... ...
     </ul>
 </nav>

Я был бы очень благодарен, если бы кто-нибудь мог взглянуть на это: D

Я использую последнюю версию суперфиша. В заголовок я включил следующее:

<script type="text/javascript">


    $(document).ready( function() {
        $('#header-navigation ul.level_1').addClass('sf-menu');
    });

    $(document).ready(function(){

        // initialise plugin
        var example = $('#header-navigation ul.level_1').superfish({});

    });

</script>

<script type="text/javascript" src="files/version9/plugins/superfish/superfish.js">       </script>
<script type="text/javascript" src="files/version9/plugins/superfish/hoverIntent.js"></script>

superfish.css содержит:

.sf-menu, .sf-menu * {
    margin: 0;
    padding: 0;
    list-style: none;
}
.sf-menu li {
    position: relative;
    min-height:40px;/*cust*/
    line-height:1.0;
}
.sf-menu ul {
    position: absolute;
    display: none;
    top: 100%;
    left: 0;
    z-index: 10000;
}
.sf-menu > li {
    float: left;
}
.sf-menu li:hover > ul,
.sf-menu li.sfHover > ul {
    display: block;
}

.sf-menu li:hover > ul,/*cust*/
.sf-menu li.sfHover > ul  li{
    display: block;
    min-height:40px;
    line-height:1.0;
}

.sf-menu a, .sf-menu span {
    display: block;
    position: relative;
    padding:12px 16px;
}


.sf-menu {
    float: left;
    margin-bottom: 1em;
    -webkit-border-bottom-right-radius: 5px;
    -webkit-border-bottom-left-radius: 5px;
    -moz-border-radius-bottomright: 5px;
    -moz-border-radius-bottomleft: 5px;
    border-bottom-right-radius: 5px;
    border-bottom-left-radius: 5px;
}
.sf-menu ul {
    box-shadow: 2px 2px 6px rgba(0,0,0,.2);
    min-width: 12em; /* allow long menu items to determine submenu width */
    *width: 12em; /* no auto sub width for IE7, see white-space comment below */
}

.sf-menu a {
    color: #13a;
}
.sf-menu li {
    background:     rgb(16, 16, 16);
    background:     rgba(16, 16, 16, 1);
    white-space: nowrap; /* no need for Supersubs plugin */
    *white-space: normal; /* ...unless you support IE7 (let it wrap) */
    -webkit-transition: background .2s;
    transition: background .2s;
}
.sf-menu ul li {
    background:     rgb(60, 60, 60);
    background:     rgba(60, 60, 60, 0.8);
}
.sf-menu li.first{
    -webkit-border-bottom-left-radius: 5px;
    -moz-border-radius-bottomleft: 5px;
    border-bottom-left-radius: 5px;
}
.sf-menu ul ul li {
    background:     rgb(51, 51, 51);
    background:     rgba(51, 51, 51, 0.8);
    height:40px;
}
.sf-menu ul ul ul li {
    background:     rgb(34, 34, 34);
    background:     rgba(34, 34, 34, 0.8);
}
.sf-menu li:hover, .sf-menu li.sfHover,
.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
    background:rgb(40,40,40);
    outline:0;
    text-shadow:
    -1px -1px 3px #fff,
    -1px -1px 4px #fff;
    text-decoration:none;
}

.sf-menu li:hover,
.sf-menu li.sfHover {
    background:     rgb(40, 40, 40);
    background:     rgba(40, 40, 40, 0.8);
    /* only transition out, not in */
    -webkit-transition: none;
    transition: none;
}

/*** arrows (for all except IE7) **/
.sf-arrows .sf-with-ul {
    padding-right: 2.5em;
    *padding-right: 1em; /* no CSS arrows for IE7 (lack pseudo-elements) */
}
/* styling for both css and generated arrows */
.sf-arrows .sf-with-ul:after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1em;
    margin-top: -3px;
    height: 0;
    width: 0;
    /* order of following 3 rules important for fallbacks to work */
    border: 5px solid transparent;
    border-top-color: #dFeEFF; /* edit this to suit design (no rgba in IE8) */
    border-top-color: rgba(255,255,255,.5);
}
.sf-arrows > li > .sf-with-ul:focus:after,
.sf-arrows > li:hover > .sf-with-ul:after,
.sf-arrows > .sfHover > .sf-with-ul:after {
    border-top-color: white; /* IE8 fallback colour */
}
/* styling for right-facing arrows */
.sf-arrows ul .sf-with-ul:after {
    margin-top: -5px;
    margin-right: -3px;
    border-color: transparent;
    border-left-color: #dFeEFF; /* edit this to suit design (no rgba in IE8) */
    border-left-color: rgba(255,255,255,.5);
}
.sf-arrows ul li > .sf-with-ul:focus:after,
.sf-arrows ul li:hover > .sf-with-ul:after,
.sf-arrows ul .sfHover > .sf-with-ul:after {
    border-left-color: white;
}

Не должно быть конфликта с моим default.css?!

default.css - раздел, содержащий # header **

#header {
    border-radius:...;

    color:#fff;
}

#header a{
    color:#fff;
    text-decoration:none;
}

#header-menu{
    width:1000px;
    height:46px;

    background: ...;

    text-align: center;

    border-radius...
}

#header-menu-elements{
    margin:5px 0;
}

#header-menu-elements{
    height:36px;
    float:left;
    background:transparent;
}

#header-navigation{
    height:40px;
    background:...;
    border-radius:...;
}
Теги:
contao
superfish

1 ответ

0
Лучший ответ

Это не из-за свойства высоты. У вашего .block есть overflow: hidden; (который также находится на вашем nav), это приводит к тому, что основная часть вашей субнавигации не видна.

  • 0
    Спасибо, только после еще нескольких настроек это работает отлично! :)

Ещё вопросы

Сообщество Overcoder
Наверх
Меню