Cách sửa Menu Elementor bị chậm delay khi hover

5/5 - (1 bình chọn)

Zubi Cloud hướng dẫn người dùng thiết kế Website bằng WordPress sử dụng Elementor để builder các landingpage chúng ta sẽ thấy ngay Menu Elementor bị chậm delay khi hover chuột qua các menu cấp 2, cấp 3 của Elementor. Điều này rất khó chịu cho người dùng lướt website của bạn.

Cách Sửa Menu Elementor Bị Chậm Delay Khi Hover
Cách Sửa Menu Elementor Bị Chậm Delay Khi Hover

Cách sửa Menu Elementor bị chậm delay khi hover như sau:

Rất đơn giản bạn chỉ cần Thêm đoạn code dưới đây vào file functions.php

add_action( 'wp_footer', function () { ?>
<script>

jQuery(document).ready(function($) {

// Get the menu instance
// Ultimately smartmenus is expecting a <ul> input, so you need to target the <ul> of the drop-down you're trying to affect.
var $menu = $('.elementor-nav-menu');

// Get rid of the existing menu
$menu.smartmenus('destroy');

// Re-instantiate the new menu, with no delay settings
$menu.smartmenus( {
subIndicatorsText: '',
subIndicatorsPos: 'append',
subMenusMaxWidth: '1000px',
hideDuration: 200, // the length of the fade-out animation
hideTimeout: 150, // timeout before hiding the sub menus
showTimeout: 0, // timeout before showing the sub menus
});

});

</script>
<?php } );

Chúc bạn thành công !

5/5 - (1 bình chọn)