将时间线添加到引导程序旋转木马
Add timeline to Bootstrap Carousel
我想知道是否有办法将脚本添加到Bootstrap的旋转木马中,这样它就可以在时间轴内显示图像。比如说,我希望在3月5日到3月11日之间显示一张图像,该图像应该会消失。我已经可以用其他幻灯片来做到这一点,比如pikachoose,但我找不到用Bootstrap的旋转木马来做到的方法。
我以前用过的剧本是这个
$(document).ready(
function (){
//Users time
var timeLocal = new Date();
var AllImages = $(".item");
var liEndDate;
var imgEndDate;
var liStartDate;
var imgStartDate;
var thisImg;
for (var i = 0; i < AllImages.length; i++) {
thisImg = AllImages[i];
liEndDate = thisImg.getAttribute("endDate");
imgEndDate = new Date(liEndDate);
liStartDate = thisImg.getAttribute("startDate");
imgStartDate = new Date(liStartDate);
if (imgStartDate > timeLocal || imgEndDate < timeLocal || liEndDate == null || liStartDate == null ) { // si timeLocal es menor a TheNext, entonces haga esto.'
//document.write(AllImages[i].outerHTML);
$(thisImg).remove();
} else {
$(thisImg).show();
}
});
</script>
但我还没能适应旋转木马谢谢
我能够更改代码并使其正常工作。然而,在图像应该被隐藏的那一刻,这会隐藏整个幻灯片。
<script language="javascript">
$(document).ready(
function () {
//Users time
var timeLocal = new Date();
var AllImages = $(".item img");
var liEndDate;
var imgEndDate;
var liStartDate;
var imgStartDate;
var thisImg;
for (var i = 0; i < AllImages.length; i++) {
thisImg = AllImages[i];
liEndDate = thisImg.getAttribute("endDate");
imgEndDate = new Date(liEndDate);
liStartDate = thisImg.getAttribute("startDate");
imgStartDate = new Date(liStartDate);
if (imgStartDate > timeLocal || imgEndDate < timeLocal || liEndDate === null || liStartDate === null) { // si timeLocal es menor a TheNext, entonces haga esto.'
//document.write(AllImages[i].outerHTML);
$(thisImg).remove();
} else {
$(thisImg).show();
}
}
});
</script>
相关文章:
- 在引导程序旋转木马中显示下一个图像
- 引导程序旋转木马未显示在页面上
- 将时间线添加到引导程序旋转木马
- 引导程序旋转木马控件
- Twitter引导程序旋转木马跳过问题
- 引导程序旋转木马错误
- Twitter引导程序旋转木马-访问当前索引
- 奇怪的引导程序旋转木马问题.第一张幻灯片最初没有加载
- 从引导程序旋转木马中的特定幻灯片开始
- 猫头鹰旋转木马和引导程序宽度显示错误
- 引导程序旋转木马控件不工作
- 引导程序滑块旋转木马与缩略图导航问题
- 推特引导程序,旋转木马上的图像覆盖
- 如何使我的引导程序旋转木马达到页面的全宽
- 引导JS 3旋转木马从左到右旋转
- 引导模式旋转木马高度问题在Firefox和Chrome
- 推特引导-使用旋转木马图像滚动到#ID
- 旋转木马引导程序
- 引导API旋转木马连续
- 为什么我的引导液旋转木马在771px到993px宽之间观看时会变得如此小