0

请查看当前的 jsbin:

http://jsbin.com/AWahuXe/12/edit

工作原理如下: 1) 菜单的子菜单关闭,直到单击 +/- 按钮打开子菜单。

以下是需要帮助的内容: 1) 单击子菜单后,新页面会正常打开,但所有子菜单会迅速展开然后折叠,这看起来不专业。我怎样才能防止这种古怪的膨胀/收缩发生?

这是我网站的链接,有助于说明膨胀/收缩问题。您也可以通过简单地刷新页面来查看这一点。

http://www.ceramictilepro.com/Ceramic-Tile-And-Grout-Tips_1.php

任何想法将不胜感激:)

这是完整的 jQuery:`

 $.each([1, 2, 3, 4, 5], function (index) {
$(".toggle" + index).click(function () {
    $(".submenu" + index).slideToggle("fast", function () {
        // Animation complete.
    });
});
});

$(function () {
var split = window.location.pathname.split('/');
var mnurl = split[split.length - 1];
mnurl = 'Ceramic-Tile-And-Grout-Tips.php';
$(' a[href="' + mnurl + '"]').addClass("_current_highlight_button");
});

$(function () {
var selected;
$('.vmenu li a').click(function (e) {
    $('.vmenu ul').not($(this).parent().next('ul')).css('display', 'none');
});
$('a').each(function () {
    if ($(this).prop('href') == window.location.href) {
        $(this).addClass('_current_highlight_button');
        selected = $(this).parent().parent();
    }
});
$('.vmenu ul').not(selected).css('display', 'none');
});

`

4

0 回答 0