简体   繁体   English

页面打开时菜单打开(下拉)

[英]Menu opens (drops down) when page opens

I am currently working on wordpress with a theme called WallBase, which you can preview here http://demo.fabthemes.com/Wallbase/ . 我目前正在使用主题为WallBase的wordpress进行工作,您可以在http://demo.fabthemes.com/Wallbase/上进行预览。

When the page fillany loads, the menu drops down. 加载页面fillany时,菜单将下拉。

I want it to stay closed, and I tried several options but I don't understand JS so, I couldn't fiz my problem, and I assume it should be pretty straightforward. 我希望它保持关闭状态,我尝试了几种方法,但我对JS不了解,因此无法解决问题,我认为它应该非常简单。

Here is the JS code I found: 这是我发现的JS代码:

jQuery(document).ready(function() {

/* Navigation */
jQuery('#submenu ul.sf-menu').superfish({ 
        delay:       500,                               // 0.1 second delay on mouseout 
        animation:   {opacity:'show',height:'show'},    // fade-in and slide-down animation 
        dropShadows: true       // disable drop shadows 

    }); 

/* Menu Show/Hide */

jQuery("#botmenu").hide();
jQuery(window).load(function()  {
jQuery('#botmenu').slideDown(1000, function() {
    jQuery('.trig').addClass("trigu");
    });
});

jQuery('.strigger').toggle(function(){

    jQuery('#botmenu').slideUp(500, function() {
    jQuery('.trig').removeClass("trigu");
    });
    }, function(){
    jQuery('#botmenu').slideDown(1000, function() {
    jQuery('.trig').addClass("trigu");
    });
    });

I'ver tried editing the js and also adding a display:none in css for .load and .slideDown but it doesn't work. 我试过编辑js,还添加了display:.css中没有.load和.slideDown的功能,但是它不起作用。

Please help me!! 请帮我!!

The code that seems like the culprit is here: 似乎是罪魁祸首的代码在这里:

jQuery(window).load(function()  {
jQuery('#botmenu').slideDown(1000, function() {
    jQuery('.trig').addClass("trigu");
    });
});

try commenting that out, because it seems to activate right when window is loaded. 请尝试将其注释掉,因为它似乎在加载窗口时立即激活。 The tall-tale sign to me is at least: jQuery(window).load(function() which in plain english means "When the window has loaded, do this" 对我而言,最jQuery(window).load(function()标志至少是: jQuery(window).load(function() ,用简单的英语表示“当窗口加载后,执行此操作”

/*
jQuery(window).load(function()  {
jQuery('#botmenu').slideDown(1000, function() {
    jQuery('.trig').addClass("trigu");
    });
});
*/

This may not completly solve the issue and the wallbase javascript might be dependent on it. 这可能无法完全解决问题,wallbase javascript可能依赖于此。 meaning, you're changing the behavior and the theme might be engineered to expect the behavior you remove. 意思是,您正在更改行为,并且主题可能被设计为期望您删除的行为。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM