滑动式菜单,带有滑动式休息菜单

时间:2015-07-13 07:17:08

标签: php html css twitter-bootstrap

我需要向下滑动多级垂直菜单,其中包含目录部分的标题

我使用bootstrap btn-group-vertical:

<?php
if($slider_enabled){
?>

<div class='clearfix'></div>
<div class='clearfix'></div>
    <div class="col-xs-3">
    <div class='index-slider1'>
        <div class="btn-group-vertical1 open" role="group" aria-label="Vertical">
<?php
    $arrarr1[0] = 0;
    $arrarr2 = array();
    $categories1 = $categories;
    $ccount=0; $ccount1=0; $ccount2=0; $clevel=0;
    while($ccount1!=count($categories)) {
        $ccount2++;
        if(count($categories1[$ccount]["childs"])>0) {
            ?>
            <div class="btn-group-vertical1 open" role="group" aria-label="Vertical">
            <button id="btnGroupVerticalDrop_<?=($ccount2.".".$ccount1.".".$clevel.".".$ccount);?>" type="button" class="btn btn-default1 dropdown-toggle dropdown-menu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <?php
                    $tcnt = -1;
                    while(++$tcnt<=$clevel) {
                        echo "&nbsp;&nbsp;&nbsp;";
                    }
                    echo $categories1[$ccount]["name"];
                ?>
                <span class="caret right1"></span>
            </button>
                <ul class="dropdown-menu1 drop" aria-labelledby="btnGroupVerticalDrop_<?=($ccount2.".".$ccount1.".".$clevel.".".$ccount);?>">
            <?php
            array_push($arrarr2, array($ccount, $categories1, $strcount));
            $categories1 = $categories1[$ccount]["childs"]; $ccount=-1;
            $clevel++;
            $strcount = substr($strcount, 0, strrpos($strcount, "."));
            ?>
            <?php
        } else {
            ?>
            <button type="button" class="btn btn-default1" id="<?=($ccount2.".".$ccount1.".".$clevel.".".$ccount);?>">
                <?php
                $tcnt = -1;
                while(++$tcnt<$clevel) {
                    echo "&nbsp;&nbsp;&nbsp;";
                }
                echo $categories1[$ccount]["name"];
                ?>
            </button>
            <?php
        }
        while($ccount==(count($categories1)-1)) {
            $arrarr1 = array_pop($arrarr2);
            $strcount = $arrarr1[2]; $categories1 = $arrarr1[1]; $ccount = $arrarr1[0];
            $clevel--;
            ?>
                </ul>
            </div>
            <?php
        }
        if(count($arrarr2)==0) {
            $ccount1++;
        }
        $ccount++;
    }
?>
        </div>
    </div>
    </div>
    <div class="col-xs-9"></div>
<?php
}
?>
<script type='text/javascript'>
$(document).ready(function(){
    $(".drop").click(function(event){
        event.stopPropagation();
    });
});
</script>

问题:第一级菜单向上滑动并向下滑动,但第二级等等则不响应。目的是制作标题部分的下滑目录,作为商品页面的链接。也许已经有了已开发目录的解决方案?

0 个答案:

没有答案