gpt4 book ai didi

javascript - iPhone 上的移动菜单不会关闭

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:15:06 24 4
gpt4 key购买 nike

有人告诉我the mobile menu on my page (可通过右上角的 3 个水平条图标访问)在 iPhone 上无法关闭。我无法检查自己,因为我没有 Apple 设备(虽然在在线 iPhone 模拟器上它确实可以运行)但我不明白为什么它可以在 Android 而不是 iPhone 上运行。

这是控制移动菜单的 JS 代码:

$( '#mobile_menu_icon' ).click(function() {
if( $( '.mobile_header_menu' ).css( 'right' ) == '-280px' ) {
$( '.mobile_header_menu' ).animate( { right: '0' }, open_delay, 'easeInOutExpo' );
$( '#wrap' ).animate({ right: '280px' }, open_delay, 'easeInOutExpo' );
$( 'body' ).addClass( 'overflow_hidden' );
}
else {
$( '.mobile_header_menu' ).animate({ right: '-280px' }, close_delay, 'easeInOutExpo' );
$( '#wrap' ).animate({ right: '0' }, close_delay, 'easeInOutExpo' );
$( 'body' ).removeClass( 'overflow_hidden' );
}
return false;
});
$( document, '.mobile_header_menu_close' ).click(function() {
if( $( '.mobile_header_menu' ).css( 'right' ) == '0px' ) {
$( '.mobile_header_menu' ).animate({ right: '-280px' }, close_delay, 'easeInOutExpo' );
$( '#wrap' ).animate({ right: '0' }, close_delay, 'easeInOutExpo' );
$( 'body' ).removeClass( 'overflow_hidden' );
}
});
$( '.mobile_header_menu_inner' ).click(function( event ) {
event.stopPropagation();
});

最佳答案

我删除了下面的部分,它起作用了。不明白为什么它在 iPhone 上会出现问题。

$( '.mobile_header_menu_inner' ).click(function( event ) {
event.stopPropagation();
});

关于javascript - iPhone 上的移动菜单不会关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33461899/

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