0
我有一个drupal网站。它响应迅速。 在手机上,常规菜单应该以下拉菜单显示。但是,当您单击导航时,菜单选项卡出现在检查元素中,但在屏幕上它只是一个普通的蓝色框,您看不到链接。菜单下拉菜单在手机上无法正确显示
<ul class="menu" style="overflow: hidden; display: block;"><li class="first leaf"><a href="/en" title="" class="active">Home</a></li>
<li class="leaf"><a href="/en/content/about-us" title="About Us">About</a></li>
<li class="expanded"><a href="/en/content/adoption">Adoption</a><ul class="menu"><li class="first leaf"><a href="/en/content/policy" title="">Policy</a></li>
<li class="leaf"><a href="/en/content/contract" title="">Contract</a></li>
<li class="leaf"><a href="/en/dogs" title="">Adopt a Dog</a></li>
<li class="leaf"><a href="/en/Cats" title="">Adopt a Cat</a></li>
<li class="last leaf"><a href="/en/virtual-adoption" title="">Virtual Adoption</a></li>
</ul><span class="drop-down-toggle"><span class="drop-down-arrow"></span></span></li>
<li class="expanded"><a href="/en/content/volunteer" title="Volunteer">Volunteer</a><ul class="menu"><li class="first leaf"><a href="/en/content/shelter">Shelter</a></li>
<li class="leaf"><a href="/en/content/volunteer-clinic">Volunteer at the Clinic</a></li>
@media screen and (max-device-width: 440px) {
.top_left,
.top_right,
.search_block,
.region-user-menu{ width: 100% !important; }
#logo { text-align: center; width: 100%; }
#site-title{ width: 100%; }
#site-title a{ width: 100%; text-align: center; float:none; /* EMS */}
.social-icons{ position: inherit; width: 100%; }
.social-icons ul{ text-align: center; }
.top_right .region-user-menu ul.menu{ float: none; }
.block-menu ul{ float: none; text-align: center; }
}
它看起来像style="overflow: hidden; display: block;"
正在被JS文件补充说,这只是出现在移动。 我有一个被称为JS脚本:
jQuery(document).ready(function($) {
$('.nav-toggle').click(function() {
$('#main-menu div ul:first-child').slideToggle(250);
return false;
});
if(($(window).width() > 640) || ($(document).width() > 640)) {
$('#main-menu li').mouseenter(function() {
$(this).children('ul').css('display', 'none').stop(true, true).slideToggle(250).css('display', 'block').children('ul').css('display', 'none');
});
$('#main-menu li').mouseleave(function() {
$(this).children('ul').stop(true, true).fadeOut(250).css('display', 'block');
})
} else {
$('#main-menu li').each(function() {
if($(this).children('ul').length)
$(this).append('<span class="drop-down-toggle"><span class="drop-down-arrow"></span></span>');
});
$('.drop-down-toggle').click(function() {
$(this).parent().children('ul').slideToggle(250);
});
}
});
这是导致该问题?我如何适应它?
权我觉得溢出:隐藏正在由JavaScript添加。它只会在手机上播放。我编辑了上面的问题来显示javascript。我如何删除它? – LTech
嗨LTech我编辑了我的答案上面,希望它会有所帮助。 –