JavaScript图像横幅计时器HTML
JavaScript image banner timer HTML
我希望能够让我的图像横幅在几秒钟后移动到下一个图像。我试过几件事,但都没用。我相信我可以使用JavaScript来做到这一点。
任何帮助都将不胜感激!
我会把代码放上去:
<div id = "imageBanner">
<div id="slideshow-wrap">
<input type="radio" id="button-1" name="controls" checked="checked"/>
<label for="button-1"></label>
<input type="radio" id="button-2" name="controls"/>
<label for="button-2"></label>
<input type="radio" id="button-3" name="controls"/>
<label for="button-3"></label>
<input type="radio" id="button-4" name="controls"/>
<label for="button-4"></label>
<input type="radio" id="button-5" name="controls"/>
<label for="button-5"></label>
<label for="button-1" class="arrows" id="arrow-1">></label>
<label for="button-2" class="arrows" id="arrow-2">></label>
<label for="button-3" class="arrows" id="arrow-3">></label>
<label for="button-4" class="arrows" id="arrow-4">></label>
<label for="button-5" class="arrows" id="arrow-5">></label>
<div id="slideshow-inner">
<ul id = "slideshow">
<li><img style="width:100%;" src="battlefield4.png" /></li>
<li><img style="width:100%;" src="fifa12.png" /></li>
<li><img style="width:100%;" src="spiderman.png" /></li>
<li><img style="width:100%;" src="mario.png" /></li>
<li><img style="width:100%;" src="wiifit.png" /></li>
</ul>
</div>
</div>
</div>
一个简单的函数,用于淡入/淡出图像。我建议在li元素上使用position:absolute;
,这样它们就可以叠放在一起。
<script>
$(function(){
$('#slideshow li:gt(0)').hide();
setInterval(function(){
$('#slideshow :first-child').fadeOut()
.next('li').fadeIn()
.end().appendTo('#slideshow');},
6000);
});
</script>
JS CODE
$(function() {
var endDate = new Date();
endDate = new Date(2017, 12 - 1, 31);
$('#dcountdown').countdown({
until: endDate
});
$('#dclose').click(function() {
$(this).parent().slideUp();
});
});
HTML代码
<div id="dbanner" class="change-color">
<div class="dcontent">
[http://carrentalchennai.in/][1] <strong> South Indian Tour Packages </strong> [Google Authorised Reseller Chennai][1] by
<code> [http://www.alphabetwebz.com/][1] </code> <span class="dtime"> [http://www.carrentalinchennai.com/][1]</span><span id="dcountdown"></span>
</div>
<div id="dclose">close me!</div>
</div>
CSS代码
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,700italic);
body {
background-color: #000;
}
#dbanner {
position: fixed;
bottom: 0px;
height: auto;
width: 100%;
padding: 30px 0 30px 0;
color: #fff;
text-align: center;
font-family: "Open Sans";
text-shadow: 1px 2px 2px rgba(0, 0, 0, 0.8);
}
.dcontent {
padding: 0px 30px 0px 30px;
font-size: 16px;
}
.dcontent strong {
font-size: 30px;
color: yellow;
white-space: nowrap;
}
.dcontent code {
font-size: 30px;
padding: 2px 5px 2px 5px;
color: #EED183;
border: 1px dashed #EED183;
background-color: #0C3D4C;
white-space: nowrap;
}
.dtime {
font-size: 18px;
background-color: #FF2A2A;
padding: 0 10px 0 10px;
white-space: nowrap;
}
#dclose {
position: absolute;
font-size: 8px;
height: 20px;
line-height: 20px;
top: 5px;
right: 10px;
color: #fff;
}
#dclose:hover {
cursor: pointer;
}
.change-color {
background-color: #107460;
color: #FFF;
text-align: center;
animation-name: homeCycle;
animation-duration: 6s;
animation-direction: alternate;
animation-iteration-count: infinite;
-webkit-animation-name: homeCycle;
-webkit-animation-duration: 6s;
-webkit-animation-direction: alternate;
-webkit-animation-iteration-count: infinite;
}
@keyframes homeCycle {
0% {
background-color: #727272;
}
25% {
background-color: #86C14D;
}
50% {
background-color: #0088CC;
}
75% {
background-color: #0C3D4C;
}
}
@-webkit-keyframes homeCycle {
0% {
background-color: #727272;
}
25% {
background-color: #86C14D;
}
50% {
background-color: #0088CC;
}
75% {
background-color: #0C3D4C;
}
}
.countdown-section {
padding: 0 5px 0 5px;
}
.countdown-amount {
padding: 0 5px 0 0;
}
.countdown-period {
text-transform: uppercase;
}
.countdown-descr {}
相关文章:
- 如何在窗体打开时从javascript倒计时计时器值中节省时间
- 设置倒计时计时器,IE出现问题
- MobileFirst:在客户端运行计时器作业-最佳选项
- 显示具有服务器端自动时间注销的同步倒计时计时器
- 倒计时计时器应该持续两个php页面
- 在Jquery倒计时计时器上设置每个数字的动画
- JavaScript图像横幅计时器HTML
- 倒计时计时器功能和带有html标签的php
- 如何编写一个函数的脚本,为HTML中显示的JavaScript计数计时器添加秒数
- 单个 HTML 页面上有多个计时器
- 简单的秒计时器使用javascript并显示在我的html中
- HTML/JavaScript:计时器/秒表不会重置(停止后)
- 在html中向计时器添加毫秒
- 在计时器html中显示毫秒
- PHP可以在计时器到期后提交HTML表单吗
- jQuery计时器可以在jsfiddle中工作,但不能在.html中工作
- 用计时器循环HTML中的图像
- 如何在同一html页面中添加多个倒计时计时器查询
- 秒表/计时器,保存var并显示在高分列表(HTML, JS)
- 每个html跨度的Javascript倒计时计时器