$(function(){ /*首页幻灯片效果 start*/ $("#j_homeslider").slide({ titcell:".xm-slider-pagination a", maincell:".xm-slider-control", autoplay:true, titonclassname:"active", effect:"fold", trigger:"click" }); $(".xm-slider").mouseenter(function(){ $(".icon-slides").css("display","inline") }) $(".xm-slider").mouseleave(function(){ $(".icon-slides").css("display","none") }) /*首页幻灯片效果 end*/ /*小米明星单品 start*/ jquery(".j_stargoodscarousel").slide({ prevcell:".box-hd .more .control-prev", nextcell:".box-hd .more .control-next", maincell:".rainbow-list", autopage:true, effect:"left", autoplay:false, vis:5, scroll:5, trigger:"click", pnloop:false }); /*小米明星单品 end*/ /* 为你推荐 */ jquery(".recommend-for-you").slide({ prevcell:".box-hd .more .control-prev", nextcell:".box-hd .more .control-next", maincell:".rainbow-list", autopage:true, effect:"left", autoplay:false, vis:5, scroll:5, trigger:"click", pnloop:false }); /*分类楼层单品鼠标经过效果*/ $(".brick-item-m").mouseenter(function(){ $(this).addclass("brick-item-active"); }).mouseleave(function(){ $(this).removeclass("brick-item-active"); }) /*首页楼层tab切换*/ $(".j_brickbox").slide({ titcell:".tab-list li", maincell:".span16", effect:"fade", autoplay:false, titonclassname:"tab-active", delaytime:0 }); /*首页倒计时广告 start*/ setinterval(function(){ $(".timer").each(function(){ var obj = $(this); var endtime = new date(parseint(obj.attr('value')) * 1000); var show_day = obj.attr('showday'); var nowtime = new date(); var nms=endtime.gettime() - nowtime.gettime() + 28800000; var myd=math.floor(nms/(1000 * 60 * 60 * 24)); var myh_show=math.floor(nms/(1000*60*60) % 24); var myh=math.floor(nms/(1000*60*60)); var mym=math.floor(nms/(1000*60)) % 60; var mys=math.floor(nms/1000) % 60; var myms=math.floor(nms/100) % 10; var a = myh+mym+mys+myms; if(a>0){ if(show_day == 'show') { var str = '剩余'+myd+'天'+myh_show+'时'+mym+'分'+mys+'秒'; } else { var str = '剩余'+myh+'时'+mym+'分'+mys+'秒'; } }else{ var str = "已结束!"; } obj.html(str); }); }, 100); /*首页倒计时广告 end*/ })