質問

[enter link description here][1] <-this is my website address open homepage showing front screen is error! put not a mouse on a parent categories. but opened all child categries. though put a mouse on a patent categories disappear.

help me please

enter image description here

this my javascript

  function megnorShowMenuPopup(objMenu, popupId)
    {
        if (typeof megnorCustommenuTimerHide[popupId] != 'undefined') clearTimeout(megnorCustommenuTimerHide[popupId]);
        objMenu = $(objMenu.id); var popup = $(popupId); if (!popup) return;
        megnorCustommenuTimerShow[popupId] = setTimeout(function() {
            popup.style.display = 'block';
            objMenu.addClassName('active');
            var popupWidth = CUSTOMMENU_POPUP_WIDTH;
            if (!popupWidth) popupWidth = popup.getWidth();
            var pos = megnorPopupPos(objMenu, popupWidth);

            popup.style.left = pos.left + 'px';
            megnorSetPopupZIndex(popup);
            if (CUSTOMMENU_POPUP_WIDTH)
                popup.style.width = CUSTOMMENU_POPUP_WIDTH + 'px';
            // --- Static Block width ---
            var block2 = $(popupId).select('div.block2');
            if (typeof block2[0] != 'undefined') {
                var wStart = block2[0].id.indexOf('_w');
                if (wStart > -1) {
                    var w = block2[0].id.substr(wStart+2);
                } else {
                    var w = 0;
                    $(popupId).select('div.block1 div.column').each(function(item) {
                        w += $(item).getWidth();
                    });
                }
                //console.log(w);
                //if (w) block2[0].style.width = w + 'px';
            }
        }, CUSTOMMENU_POPUP_DELAY_BEFORE_DISPLAYING);
    }

    function megnorHideMenuPopup(element, event, popupId, menuId)
    {
        if (typeof megnorCustommenuTimerShow[popupId] != 'undefined') clearTimeout(megnorCustommenuTimerShow[popupId]);
        element = $(element.id); var popup = $(popupId); if (!popup) return;
        var current_mouse_target = null;
        if (event.toElement) {
            current_mouse_target = event.toElement;
        } else if (event.relatedTarget) {
            current_mouse_target = event.relatedTarget;
        }
        megnorCustommenuTimerHide[popupId] = setTimeout(function() {
            if (!megnorIsChildOf(element, current_mouse_target) && element != current_mouse_target) {
                if (!megnorIsChildOf(popup, current_mouse_target) && popup != current_mouse_target) {
                    popup.style.display = 'none';
                    $(menuId).removeClassName('active');
                }
            }
        }, CUSTOMMENU_POPUP_DELAY_BEFORE_HIDING);
    }

    function megnorPopupOver(element, event, popupId, menuId)
    {
        if (typeof megnorCustommenuTimerHide[popupId] != 'undefined') clearTimeout(megnorCustommenuTimerHide[popupId]);
    }

    function megnorPopupPos(objMenu, w)
    {
        var pos = objMenu.cumulativeOffset();
        var wraper = $('advancedmenu');
        var posWraper = wraper.cumulativeOffset();
        var wWraper = wraper.getWidth() - CUSTOMMENU_POPUP_RIGHT_OFFSET_MIN;

        var xLeft = pos.left - posWraper.left;
        if ((xLeft + w) > wWraper) xLeft = wWraper - w;
        return {'left': xLeft};
    }

    function megnorIsChildOf(parent, child)
    {
        if (child != null) {
            while (child.parentNode) {
                if ((child = child.parentNode) == parent) {
                    return true;
                }
            }
        }
        return false;
    }

    function megnorSetPopupZIndex(popup)
    {
        $$('.megnor-advanced-menu-popup').each(function(item){
           item.style.zIndex = '9999';
        });
        popup.style.zIndex = '10000';
    }

Php code:

this my php code

<?php $_categories = $this->getStoreCategories() ?>
    <?php if(count($_categories)): ?>

    <div class="block block-advancedmenu">
    <div class="block-title">
            <strong><span><?php echo $this->__('Categories'); ?></span></strong>
    </div>
    <div class="block-content" >
        <div id="advancedmenu">
            <?php if ($this->showHomeLink()) : ?>
            <div class="menu">
                <div class="parentMenu menu0 home_link">
                </div>
            </div>
            <?php endif ?>

              <?php $m=0; ?>
             <?php $n=0; ?>
            <?php foreach ($_categories as $_category): ?>
                <?php $m++; 
                if($m<11){   ?>
                <?php echo $this->drawAdvancedMenuItem($_category) ?>
                <?php }else{ ?>
            <div class="menu seeall">
                <div class="subparentMenu menu0 seeall">
                    <div class="subparentmenu-hover">
                    <div class="super-sub">
                   <?php foreach ($_categories as $_category): ?>
                    <?php $n++;
                    if($n<11){}else{ ?>
                     <?php echo $this->drawAdvancedMenuItem($_category) ?>
                     <?php } ?>
                   <?php endforeach ?>
                   </div>
                    </div>
                </div>
            </div>              
                <?php break;    }?>
            <?php endforeach ?>



            <?php if ($this->isActivecustomBlock()) : 
                $custom_block_name =  Mage::getStoreConfig('advanced_menu/customblock/menucustomblock_name'); 
                $custom_block_identifier =  Mage::getStoreConfig('advanced_menu/customblock/customblock_identifier'); 
                $custom_topoffset = Mage::getStoreConfig('advanced_menu/popup/top_offset') + 0;
            ?>

            <div class="menu">
                <div class="custom_menu menu">
                    <a><span><?php echo $custom_block_name; ?></span></a>
                <div class="customblock_inner megnor-advanced-menu-popup" style="top:<?php echo $custom_topoffset; ?>px">
                    <div class="megnor-advanced-menu-popup_inner">
                        <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId($custom_block_identifier)->toHtml() ?> 
                    </div>  
                </div>
                </div>
            </div>
            <?php  endif;?> 

    </div>  <!-- advancedmenu -->   
    </div> <!-- block-content -->   


    <script type="text/javascript">
    //<![CDATA[
    var CUSTOMMENU_POPUP_WIDTH = <?php echo Mage::getStoreConfig('advanced_menu/popup/width') + 0; ?>;
    var CUSTOMMENU_POPUP_TOP_OFFSET = <?php echo Mage::getStoreConfig('advanced_menu/popup/top_offset') + 0; ?>;
    var CUSTOMMENU_POPUP_RIGHT_OFFSET_MIN = <?php echo Mage::getStoreConfig('advanced_menu/popup/right_offset_min') + 0; ?>;
    var CUSTOMMENU_POPUP_DELAY_BEFORE_DISPLAYING = <?php echo Mage::getStoreConfig('advanced_menu/popup/delay_displaying') + 0; ?>;
    var CUSTOMMENU_POPUP_DELAY_BEFORE_HIDING = <?php echo Mage::getStoreConfig('advanced_menu/popup/delay_hiding') + 0; ?>;
    var megnorCustommenuTimerShow = {};
    var megnorCustommenuTimerHide = {};
    //]]>
    </script>
    </div><!-- block-advancedmenu -->   
    <?php endif ?>
役に立ちましたか?

解決

Try to check your css clases and JavaScript code. If you want more help, share your code of the display categories, JS and CSS code too.

他のヒント

Try something like

$(function() {
   $('.megnor-advanced-menu-popup').hide();
});

at the top of your javascript

ライセンス: CC-BY-SA帰属
所属していません magento.stackexchange
scroll top