我有一个 magento 1.6.2 网上商店。
我想合并 javascript 文件以优化我的加载速度。但是当我在设置中选择合并时,我的自定义菜单扩展不再起作用。
我猜代码有问题。我试图联系开发商,但我没有得到任何反应...
此扩展程序用于顶部的导航菜单(带图像)
这是 custommenu.js 文件的代码:
function wpShowMenuPopup(objMenu, popupId)
{
objMenu = $(objMenu.id); var popup = $(popupId); if (!popup) return;
popup.style.display = 'block';
objMenu.addClassName('active');
var popupWidth = CUSTOMMENU_POPUP_WIDTH;
if (!popupWidth) popupWidth = popup.getWidth();
var pos = wpPopupPos(objMenu, popupWidth);
popup.style.top = pos.top + 'px';
popup.style.left = pos.left + 'px';
if (CUSTOMMENU_POPUP_WIDTH) popup.style.width = CUSTOMMENU_POPUP_WIDTH + 'px';
}
function wpPopupPos(objMenu, w)
{
var pos = objMenu.cumulativeOffset();
var wraper = $('custommenu');
var posWraper = wraper.cumulativeOffset();
var wWraper = wraper.getWidth() - CUSTOMMENU_POPUP_RIGHT_OFFSET_MIN;
var xTop = pos.top - posWraper.top + CUSTOMMENU_POPUP_TOP_OFFSET;
var xLeft = pos.left - posWraper.left;
if ((xLeft + w) > wWraper) xLeft = wWraper - w;
return {'top': xTop, 'left': xLeft};
}
function wpHideMenuPopup(element, event, popupId, menuId)
{
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;
}
if (!wpIsChildOf(element, current_mouse_target) && element != current_mouse_target)
{
if (!wpIsChildOf(popup, current_mouse_target) && popup != current_mouse_target)
{
popup.style.display = 'none';
$(menuId).removeClassName('active');
}
}
}
function wpIsChildOf(parent, child)
{
if (child != null)
{
while (child.parentNode)
{
if ((child = child.parentNode) == parent)
{
return true;
}
}
}
return false;
}
你可以在我的网上商店看到它:www.liefstoereigenwijs.nl
谁能看看代码中是否有问题?或者对我的问题有其他解决方案吗?