Browse Source

更新内容

moshaorui 2 tháng trước cách đây
mục cha
commit
51ad73f554
1 tập tin đã thay đổi với 13 bổ sung2 xóa
  1. 13 2
      public/static/js/script.js

+ 13 - 2
public/static/js/script.js

@@ -226,10 +226,21 @@ $(document).ready(function() {
 	});
 	// Settings END
 
-    $('.menu-nav-item a').first().click(function () {
-        $(this).parent().find('.menu-nav-son').stop(true, true).slideToggle(200);
+    // $('.menu-nav-item').first().click(function () {
+    //     console.log('first11');
+    //     $(this).parent().find('.menu-nav-son').stop(true, true).slideToggle(200);
+    // });
+
+    $('.menu-nav-item').each(function() {
+        var firstLink = $(this).find('a').first();
+        firstLink.on('click', function(event) {
+            event.preventDefault(); // 阻止默认行为(如跳转)
+            console.log('first11');
+            $(this).parent().find('.menu-nav-son').stop(true, true).slideToggle(200);
+        });
     });
 
+
 	// $('.menu-nav-son-li').hover(
 	// 	function () {
 	// 		// 显示当前 li 的子菜单