时间倒计时-11
<div class="main1_1_right main1_1_right1">
<p class="lx">联系人:王二 电话:010-61723357</p>
<p id="time" class="time2">还剩:<span>00</span>天<span>00</span>小时<span>00</span>分<span>00</span>秒</p>
<em class="cc1"><a href="#" target="_blank">更多</a></em>
</div>
.main2{ margin-top:24px;}
#time{ font-size:18px; color:#333;}
#time span{ background:url(../images/bg2.png) no-repeat; width:35px; height:27px; display:block; text-align:center; line-height:27px; color:#FFF; display:inline-block; margin:0 4px; font-size:18px;}
.main1_1_right1 #time span{ background:url(../images/bg3.png) no-repeat;}
.main1_1_right2 #time span{ background:url(../images/bg4.png) no-repeat;}
.main1_1_right3 #time span{ background:url(../images/bg5.png) no-repeat;}
.main1_1_right4 #time span{ background:url(../images/bg6.png) no-repeat;}
.main1_1_right .lx{ color:#676767; margin-right:160px; line-height:42px;}
$(document).ready(function(){
//banner1
function st(a1,b1,c1,d1,e1){
var ow=a1.width();
var repeat;
var index=0;
var len=a1.length;
c1.hover(function(){
clearInterval(repeat)
},function(){
repeat=setInterval(function(){
index++;
if(index==len)
index=0;
ht(index)
},3000)
}).trigger("mouseout");
b1.mouseover(function(){
index=b1.index(this);
ht(index)
});
function ht(index){
d1.stop().animate({"marginLeft":-ow*index});
b1.eq(index).addClass(e1).siblings().removeClass(e1);
};
};
st($(".wwul li"),$(".olbg li"),$(".bannerbox"),$(".wwul"),("hbg1"));
//点击效果
var ww1=$(".boxw1 li").outerWidth(true);
var li_length1=$(".boxw1 li").length;
$(".p_left1").click(function(){
$(".boxw1").animate({"marginLeft":-ww1},500,function(){
var firstli1=$( ".boxw1 li:first" );
firstli1.appendTo( ".boxw1" );
$( ".boxw1" ).css({"marginLeft":0});
});
});
$(".p_right1").click(function(){
var lastli1=$( ".boxw1 li:last" );
lastli1.prependTo( ".boxw1" );
$( ".boxw1" ).css({"marginLeft":-ww1});
$(".boxw1").animate({"marginLeft":0},500);
});
//时间倒计时 1
function showtime() {
Today = new Date();
var NowYear = Today.getFullYear();
var NowMonth = Today.getMonth();
var NowDate = Today.getDate();
var NowHour = Today.getHours();
var NowMinute = Today.getMinutes();
var NowSecond = Today.getSeconds();
//计算距离的时间
Hourleft = 23 - NowHour
Minuteleft = 59 - NowMinute
Secondleft = 59 - NowSecond
Yearleft = 2019 - NowYear
Monthleft = 6 - NowMonth - 1
Dateleft = 12 - NowDate
if (Secondleft<0){
Secondleft=60+Secondleft;
Minuteleft=Minuteleft-1;
};
if (Minuteleft<0){
Minuteleft=60+Minuteleft;
Hourleft=Hourleft-1;
};
if (Hourleft<0){
Hourleft=24+Hourleft;
Dateleft=Dateleft-1;
};
if (Dateleft<0){
Dateleft=31+Dateleft;
Monthleft=Monthleft-1;
};
if (Monthleft<0){
Monthleft=12+Monthleft;
Yearleft=Yearleft-1;
};
if(Yearleft<0||Monthleft<0||Dateleft<0||Hourleft<0||Minuteleft<0||Secondleft<0){
Yearleft=0,
Monthleft=0,
Dateleft=0,
Hourleft=0,
Minuteleft=0,
Secondleft=0
};
if(Yearleft==0&&Monthleft==0&&Dateleft==0&&Hourleft==0&&Minuteleft==0&&Secondleft==0){
clearInterval(timer);
};
Datelefts=Dateleft+Monthleft*30;
Dateleftss=Dateleft+Monthleft*30;
$(".time1").html("还剩<span>"+Datelefts+"</span>天<span>"+Hourleft+"</span>时<span>"+Minuteleft+"</span>分<span>"+Secondleft+"</span>秒");
$(".time2").html("还剩<span>"+Datelefts+"</span>天<span>"+Hourleft+"</span>时<span>"+Minuteleft+"</span>分<span>"+Secondleft+"</span>秒");
$(".time3").html("还剩<span>"+Datelefts+"</span>天<span>"+Hourleft+"</span>时<span>"+Minuteleft+"</span>分<span>"+Secondleft+"</span>秒");
$(".time4").html("还剩<span>"+Datelefts+"</span>天<span>"+Hourleft+"</span>时<span>"+Minuteleft+"</span>分<span>"+Secondleft+"</span>秒");
$(".time5").html("还剩<span>"+Datelefts+"</span>天<span>"+Hourleft+"</span>时<span>"+Minuteleft+"</span>分<span>"+Secondleft+"</span>秒");
};
var timer=setInterval(function(){
showtime();
},1000);
$(window).scroll(function(){
if($(this).scrollTop()>140){
$(".head-top").addClass('fixed')
}else{
$(".head-top").removeClass('fixed')
};
});
});