jQuery pagination + Twitter Bootstrap

后端 未结 5 757
有刺的猬
有刺的猬 2020-12-29 13:32

I\'m trying to modify a Jquery pagination (based on this Jquery pagination tutorial - demo) to work with the awesome twitter bootstrap.

Twitter Bootstrap\'s standard

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-29 14:13

    I totally forgot this post
    However i managed to make it work with the following code:

    // Based on http://stackoverflow.com/questions/1262919/jquery-active-class-assignment and http://stackoverflow.com/questions/2037501/javascript-add-class-when-link-is-clicked
    
    $(function() {
        $('ul.nav li:first').addClass('active').show(); //Activate first tab
        $('li a').click(function(e) {
            //e.preventDefault();
            var $this = $(this);
            $this.closest('ul').children('li').removeClass('active');
            $this.parent().addClass('active');
    
            //Remove active from dropdown li
            $('.dropdown').removeClass('active');
    
            // Activate Home when clicked on the logo
            $('.thelogo').click(function()
                {
                  $('.nav li').removeClass('active');
                  $('.home').addClass('active');
                });
        });
    });
    

提交回复
热议问题