![]() | 1 switch 2014-06-21 22:47:25 +08:00 先匹配到 ul.submenu 再查找到 .submenu-header: $this.closest("ul.submenu").children("li.submenu-header").text(); |
![]() | 3 paloalto 2014-06-21 23:14:38 +08:00 $ul.on('click', 'span.text', function (e) { }) |
![]() | 4 paloalto 2014-06-21 23:21:02 +08:00 @kstsca 1楼 给出的 $this.clesest('ul.submenu') 就是离 this 最近的那个 ul . 可以定位到的。 而且可以直接匹配 id 啊,ul#form 是唯一的嘛。 可以不用 this 的: $ul.on('click', 'span.text', function (e) { var text = $('ul#form .submenu-header').text(); $('.page-header-section .semibold').text(text); }) |
![]() | 8 liyandong 2014-06-22 19:37:59 +08:00 找父亲的文章儿子 |