- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要在多个 Bootstrap 选项卡面板中插入一系列轮播,每个面板一个轮播。
如下所示,(jsfiddle here)
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<style>
.span2 {
white-space:normal;
}
.item-block {
background-color: #ccc;
}
</style>
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="panel with-nav-tabs panel-default">
<div class="panel-heading">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab1default" data-toggle="tab">Default 1</a></li>
<li><a href="#tab2default" data-toggle="tab">Default 2</a></li>
</ul>
</div>
<div class="panel-body">
<div class="tab-content">
<div class="tab-pane active" id="tab1default">
<div id="slideshow2" class="cycle-slideshow"
data-cycle-fx=carousel
data-cycle-timeout=0
data-cycle-carousel-visible=1
data-cycle-carousel-fluid=true
data-cycle-pager="#pager1"
data-cycle-pager-template="<a href='#'><i class='fa fa-square' aria-hidden='true'></i></a>"
data-cycle-slides="> .span2"
>
<div class="pull-left cycle-prev"><a href="#"><i class="fa fa-chevron-left" aria-hidden="true"></i> Prev</a></div>
<div class="pull-right cycle-next"><a href="#">Next <i class="fa fa-chevron-right" aria-hidden="true"></i></a></div>
<div class="span2">
<div class="item-block col-md-4">
<img class="img-responsive" src="http://lorempixel.com/200/200/">
<div class="text-center">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus molestie porta leo, eget varius sem elementum eget. Fusce ullamcorper odio lacus, id auctor urna vulputate a. Vestibulum accumsan tortor ac massa aliquet, at feugiat metus faucibus. Phasellus sagittis dui at accumsan interdum. Vivamus eget tempus est. Curabitur semper feugiat risus, id consequat leo fermentum in. Suspendisse tristique interdum orci id pharetra. Sed sit amet sodales massa. </div>
</div>
<div class="item-block col-md-4">
<img class="img-responsive" src="http://lorempixel.com/200/200/">
<div class="text-center">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus molestie porta leo, eget varius sem elementum eget. Fusce ullamcorper odio lacus, id auctor urna vulputate a. Vestibulum accumsan tortor ac massa aliquet, at feugiat metus faucibus. Phasellus sagittis dui at accumsan interdum. Vivamus eget tempus est. Curabitur semper feugiat risus, id consequat leo fermentum in. Suspendisse tristique interdum orci id pharetra. Sed sit amet sodales massa. </div>
</div>
<div class="item-block col-md-4">
<img class="img-responsive" src="http://lorempixel.com/200/200/">
<div class="text-center">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus molestie porta leo, eget varius sem elementum eget. Fusce ullamcorper odio lacus, id auctor urna vulputate a. Vestibulum accumsan tortor ac massa aliquet, at feugiat metus faucibus. Phasellus sagittis dui at accumsan interdum. Vivamus eget tempus est. Curabitur semper feugiat risus, id consequat leo fermentum in. Suspendisse tristique interdum orci id pharetra. Sed sit amet sodales massa. </div>
</div>
</div>
<div class="span2">
<div class="col-md-4">
<img class="img-responsive" src="http://lorempixel.com/200/200/">
<div class="text-center">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus molestie porta leo, eget varius sem elementum eget. Fusce ullamcorper odio lacus, id auctor urna vulputate a. Vestibulum accumsan tortor ac massa aliquet, at feugiat metus faucibus. Phasellus sagittis dui at accumsan interdum. Vivamus eget tempus est. Curabitur semper feugiat risus, id consequat leo fermentum in. Suspendisse tristique interdum orci id pharetra. Sed sit amet sodales massa. </div>
</div>
<div class="col-md-4">
<img class="img-responsive" src="http://lorempixel.com/200/200/">
<div class="text-center">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus molestie porta leo, eget varius sem elementum eget. Fusce ullamcorper odio lacus, id auctor urna vulputate a. Vestibulum accumsan tortor ac massa aliquet, at feugiat metus faucibus. Phasellus sagittis dui at accumsan interdum. Vivamus eget tempus est. Curabitur semper feugiat risus, id consequat leo fermentum in. Suspendisse tristique interdum orci id pharetra. Sed sit amet sodales massa. </div>
</div>
<div class="col-md-4">
<img class="img-responsive" src="http://lorempixel.com/200/200/">
<div class="text-center">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus molestie porta leo, eget varius sem elementum eget. Fusce ullamcorper odio lacus, id auctor urna vulputate a. Vestibulum accumsan tortor ac massa aliquet, at feugiat metus faucibus. Phasellus sagittis dui at accumsan interdum. Vivamus eget tempus est. Curabitur semper feugiat risus, id consequat leo fermentum in. Suspendisse tristique interdum orci id pharetra. Sed sit amet sodales massa. </div>
</div>
</div>
</div>
<div class="text-center cycle-pager" id="pager1"></div>
</div>
<div class="tab-pane" id="tab2default">
<div id="slideshow1" class="cycle-slideshow"
data-cycle-fx=carousel
data-cycle-timeout=0
data-cycle-carousel-visible=1
data-cycle-carousel-fluid=true
data-cycle-pager="#pager2"
data-cycle-pager-template="<a href='#'><i class='fa fa-square' aria-hidden='true'></i></a>"
data-cycle-slides="> .span2"
>
<div class="pull-left cycle-prev"><a href="#"><i class="fa fa-chevron-left" aria-hidden="true"></i> Prev</a></div>
<div class="pull-right cycle-next"><a href="#">Next <i class="fa fa-chevron-right" aria-hidden="true"></i></a></div>
<div class="span2">
<div class="item-block col-md-4">
<img class="img-responsive" src="http://lorempixel.com/200/200/">
<div class="text-center">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus molestie porta leo, eget varius sem elementum eget. Fusce ullamcorper odio lacus, id auctor urna vulputate a. Vestibulum accumsan tortor ac massa aliquet, at feugiat metus faucibus. Phasellus sagittis dui at accumsan interdum. Vivamus eget tempus est. Curabitur semper feugiat risus, id consequat leo fermentum in. Suspendisse tristique interdum orci id pharetra. Sed sit amet sodales massa. </div>
</div>
<div class="item-block col-md-4">
<img class="img-responsive" src="http://lorempixel.com/200/200/">
<div class="text-center">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus molestie porta leo, eget varius sem elementum eget. Fusce ullamcorper odio lacus, id auctor urna vulputate a. Vestibulum accumsan tortor ac massa aliquet, at feugiat metus faucibus. Phasellus sagittis dui at accumsan interdum. Vivamus eget tempus est. Curabitur semper feugiat risus, id consequat leo fermentum in. Suspendisse tristique interdum orci id pharetra. Sed sit amet sodales massa. </div>
</div>
<div class="item-block col-md-4">
<img class="img-responsive" src="http://lorempixel.com/200/200/">
<div class="text-center">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus molestie porta leo, eget varius sem elementum eget. Fusce ullamcorper odio lacus, id auctor urna vulputate a. Vestibulum accumsan tortor ac massa aliquet, at feugiat metus faucibus. Phasellus sagittis dui at accumsan interdum. Vivamus eget tempus est. Curabitur semper feugiat risus, id consequat leo fermentum in. Suspendisse tristique interdum orci id pharetra. Sed sit amet sodales massa. </div>
</div>
</div>
<div class="span2">
<div class="col-md-4">
<img class="img-responsive" src="http://lorempixel.com/200/200/">
<div class="text-center">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus molestie porta leo, eget varius sem elementum eget. Fusce ullamcorper odio lacus, id auctor urna vulputate a. Vestibulum accumsan tortor ac massa aliquet, at feugiat metus faucibus. Phasellus sagittis dui at accumsan interdum. Vivamus eget tempus est. Curabitur semper feugiat risus, id consequat leo fermentum in. Suspendisse tristique interdum orci id pharetra. Sed sit amet sodales massa. </div>
</div>
<div class="col-md-4">
<img class="img-responsive" src="http://lorempixel.com/200/200/">
<div class="text-center">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus molestie porta leo, eget varius sem elementum eget. Fusce ullamcorper odio lacus, id auctor urna vulputate a. Vestibulum accumsan tortor ac massa aliquet, at feugiat metus faucibus. Phasellus sagittis dui at accumsan interdum. Vivamus eget tempus est. Curabitur semper feugiat risus, id consequat leo fermentum in. Suspendisse tristique interdum orci id pharetra. Sed sit amet sodales massa. </div>
</div>
<div class="col-md-4">
<img class="img-responsive" src="http://lorempixel.com/200/200/">
<div class="text-center">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus molestie porta leo, eget varius sem elementum eget. Fusce ullamcorper odio lacus, id auctor urna vulputate a. Vestibulum accumsan tortor ac massa aliquet, at feugiat metus faucibus. Phasellus sagittis dui at accumsan interdum. Vivamus eget tempus est. Curabitur semper feugiat risus, id consequat leo fermentum in. Suspendisse tristique interdum orci id pharetra. Sed sit amet sodales massa. </div>
</div>
</div>
</div>
<div class="text-center cycle-pager" id="pager2"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://malsup.github.com/jquery.cycle2.js"></script>
<script src="https://malsup.github.com/jquery.cycle2.carousel.js"></script>
第一个选项卡面板中的轮播工作正常,我们可以在幻灯片之间翻转。
但是,第二个选项卡面板无法正确呈现轮播。奇怪的是,当打开 Chrome 检查器/控制台并选择第二个选项卡面板时,轮播会正确渲染并正常运行。
此时,单击第一个选项卡会显示第一个选项卡面板现在渲染不正确。此外,在此阶段关闭 Chrome 检查器实际上修复了第一个选项卡面板的错误渲染内容。
这可能是 Cycle2 的一个错误,还是我只是在这里遗漏了一些东西?
最佳答案
今天早上我又想了一些,并想到了在选项卡点击事件上重新初始化轮播:
<script>
$( document ).ready(function() {
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
$('.cycle-slideshow').cycle('reinit');
});
});
</script>
目前看来效果还不错。更新了jsfiddle here .
关于javascript - 在 Bootstrap 选项卡面板中创建 Cycle2-carousel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41113883/
我们将 Azure Boards(与敏捷流程相关的项目)定义为“功能”>“史诗”>“任务”>“用户故事”。 在我们的Azure Boards(Boards >Board)中,它仅显示Epic和Feat
我正在编写一个 C++ 井字游戏,这是我目前拥有的: #include using namespace std; int main() { board *b; b->draw();
这是一个足够简单的问题。 看完documentation for ion-pane它指出: A simple container that fits content, with no side eff
关闭。这个问题是opinion-based .它目前不接受答案。 想改进这个问题?更新问题,以便 editing this post 可以用事实和引用来回答它. 4年前关闭。 Improve this
我正在用 javascript 对 arduino 开发板进行编程。我正在尝试使用 johnny-five 库连接多个 arduino 板。我关注了johnny-five documentation我
在我的 Java 类(class)中,我们正在学习《Java 基础知识》一书的第 4 章。我正在做项目 4-11,它是一个黑色和红色的棋盘格,但是我得到随机颜色,我试图按照本书教我们使用 ColorP
我正在制作一个数独板 GUI,它应该看起来像这样 http://www.sudoku.4thewww.com/Grids/grid.jpg 由于某种原因,它只显示最后一个 3*3 板。如果有人能告诉我
我正在开发一款带有二维阵列(游戏板)的新游戏。每个单元格/图 block 都有一定数量的点。 我想实现的是一个算法能找到核心最高的最短路径。 所以我首先实现了 Dijkstra 算法(下面的源代码)来
更新:(2015-10-16)[已解决!]-使用trigger()并通过slice()限制为50个引脚固定。 非常感谢Abhas Tandon通过提供使用 $(this).trigger('click
关闭。这个问题需要更多focused .它目前不接受答案。 想改善这个问题吗?更新问题,使其仅关注一个问题 editing this post . 7年前关闭。 Improve this questi
var size = 8; var board = ""; for (var y = 0; y x= (x+y) % 2 = 关于javasc
我正在制作一个简单的游戏,需要我创建一个由用户定义大小的棋盘。 我一直在编写一个函数,该函数应该返回我将在我的游戏中使用的棋盘(矩阵),但我似乎无法让它工作。 我尝试使用嵌套的 for 循环方法在 m
我正在尝试让板模板引擎与 express.js 一起工作。我最初的尝试是这样的: app.register('.html', { compile: function (str, options
我正在测试 Azure Boards Rest API。我目前可以成功创建、删除和获取项目,但我似乎无法在列之间移动它们。 这是我的要求https://{{AzureBoardsToken}}@{{A
我想用 trello api 归档一个板/列表,但我找不到解决方案。 与 https://trello.com/docs/api/list/#post-1-lists-idlist-archiveal
我上传了 sketch到一个 Arduino Uno,它的循环是这样的: void loop(){ Serial.println("Hello, World!"); } 所以,现在,我无法再上
我想要进行一个查询,显示结构 Epic -> 功能 -> 发布 -> 用户故事 -> 任务,以及特定迭代路径下的所有待处理任务 我尝试使用工作项树,但它只显示到 mu 用户故事 我的 Azure De
我在 python 中使用来自 Opencv 的 Charuco 标记。我之前使用的是 Aruco 开发板,我可以选择创建一个带有 id 偏移量(例如:偏移量为 40)的开发板。 from cv2 i
我不知道如何将另一个 View 中的辅助 Anchorpane 设置到主 View 的边界(在 fxml 代码中,它将是名为 holderPane 并且有灰色区域),这样当窗口展开时,它也会随之拉伸(
如何使用包含列、行和堆栈(包含 4、3、2、1)的 3D 通用数组制作一 block 板。 这是我声明的: private int row, col, stack; int[][][] array3D
我是一名优秀的程序员,十分优秀!