get the details corresponding to particular tab on click of it

前端 未结 2 414
死守一世寂寞
死守一世寂寞 2021-01-25 13:03

Html part:

相关标签:
2条回答
  • 2021-01-25 13:14

    You need to add a click handler

    jQuery(function($) {
        $('.tabbable ul li').click(function() {
            var id = $(this).find('a').attr('href').substring(1);
            loadUsers(id);
        })
    })
    
    0 讨论(0)
  • 2021-01-25 13:22

    You should create an event handler for that such as:

    $(document).on('click', '.nav li', function() { // Clicking any li in your .nav-element
    
     loadType = $(this).children("a").prop("href"); 
     //parse out # from #BO
     // call loadUsers, loadUserDetails etc.
    
    });
    
    0 讨论(0)
提交回复
热议问题