【问题标题】:Bootstrap Tab Pagination [closed]Bootstrap选项卡分页[关闭]
【发布时间】:2014-11-27 15:48:57
【问题描述】:

我一直在网上搜索引导选项卡分页 sn-p,但在任何地方都找不到,所以我想我会使用 JQuery 将一些东西放在一起并与您可爱的人分享!

希望这对某人有所帮助

【问题讨论】:

  • 那我就删了!

标签: jquery twitter-bootstrap tabs pagination


【解决方案1】:

这就是答案。

//.pager is the pagination container
$('.pager').find('.previous, .next').click(function(e) {
    e.preventDefault();
    //.nav-tabs is the tabs container
    var tabs = $('.nav-tabs');
    var currentTab = $(tabs).find('.active');
    var previousTab = $(currentTab).prev();
    var nextTab = $(currentTab).next();
    //find if the event's class is next or previous
    if ( $(this).is('.previous') ) {
        $(previousTab).find('a').click();
    }
    if ( $(this).is('.next') ) {
        $(nextTab).find('a').click();
    }
});

【讨论】:

  • 不错。你能提供一个示范吗?这是一个 Bootstrap 基础小提琴:jsfiddle.net/isherwood/bz88LrLn
  • 哦,是的,我马上就有事情了 :-)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-09-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-05-04
  • 1970-01-01
相关资源
最近更新 更多