gpt4 book ai didi

javascript - 我如何通过 jQuery 显示 foundation.css dropmenu

转载 作者:太空宇宙 更新时间:2023-11-04 11:34:52 24 4
gpt4 key购买 nike

我尝试用 foundation.css 写一个导航栏,但是当鼠标移动时子菜单不显示。

问题是,如何在this webpage中显示test的子菜单? .

我尝试更改visibilitydisplayz-indexleft,但没有任何反应。

最佳答案

foundation.css 好像不是标准的css库

只需添加以下js脚本即可。 Click here to see the magic

基本思路是改变.dropdownclip来显示和隐藏它。

function drop_show(a) {
var s = '#'+a + " ul.dropdown";
$(s).css('clip', 'auto');
}

function drop_hide(a) {
var s = '#'+a + " ul.dropdown";
$(s).css('clip', 'rect(1px, 1px, 1px, 1px)')
}
var drop_a = $('.has-dropdown');
drop_a.each(function() {
$(this).attr("onMouseOver", "drop_show('" + $(this).attr('id') + "');");
$(this).attr("onMouseout", "drop_hide('" + $(this).attr('id') + "');");
})

关于javascript - 我如何通过 jQuery 显示 foundation.css dropmenu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31811703/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com