Banner Second Kill

Source: Internet
Author: User

Always show no start/In progress (need to use two for loop, first I didn't think, poem Jayne helped me write)

functiontimelist () {myTime=NewDate (). GetTime ()varItem,starttime,endtime;  for(vari = 0; i < t_new.length; i++) {Item=T_new[i]; StartTime=NewDate (item.starttime). GetTime (); EndTime=NewDate (item.endtime). GetTime (); if(Mytime<starttime) {//activity not startedShowTime (i);  Break; }Else{                if(Mytime<=endtime) {//Activities in ProgressShowTime (i);  Break; }            }                 }    }    varlihtml = ""; functionShowTime (index) {varitem =T_new[index], StartTime=NewDate (item.starttime). GetTime (), EndTime=NewDate (item.endtime). GetTime (); Console.log (Index,NewDate (StartTime),NewDate (endTime)); Lihtml= "";        Timelistdiv.empty (); MyTime=NewDate (). GetTime (); if(mytime<startTime) {            //Console.log ("Not started yet", index);Counterdown (Index,starttime, "distance from the beginning"); }Else if(mytime>endTime) {            //Console.log ("End of the event");Clearcount (); }Else{            //Console.log ("The distance is Over");Counterdown (Index+1,endtime, "The distance is over"); }         for(vari = 0; i<t_new.length; i++) {Item=T_new[i]; StartTime=NewDate (item.starttime). GetTime (); EndTime=NewDate (item.endtime). GetTime (); if(MyTime >endTime) {                //events that exceedLihtml +=getlisthtml (i, "closed", Item.starttime); }Else if(MyTime <startTime) {                //activities earlier thanLihtml +=getlisthtml (i, "not started", Item.starttime); }Else{                //activities in progressLihtml +=getlisthtml (I, "in progress", Item.starttime);        }} timelistdiv.append (lihtml); Btndiv= $ ("#timeList a"); Animateevent (Index,true); }

Banner Second Kill

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.