var mcode={"minfo":[{" time":"9:00-10:00","status":2},{"time":"10:00-11:00","status":1},{"time":"11: 00-12:00","status":3},{"time":"13:00-14:00","status":1},{"time":"14:00-15:00" ,"status":1},{"time":"15:00-16:00","status":1},{"time":"16:00-17:00","status":1 },{"time":"17:00-18:00","status":1}]};
where time represents the time period, status represents when the position is 1 it can be used, and when it is 2 it represents Expired, 3 o'clock means it has been selected. Loop through the data values in the json string.
for(var i in mcode.minfo){ mcode.minfo[i].time mcode.minfo[i].status; }
When the current time period has expired or is full, move the mouse to its current time period The corresponding information will be prompted when it is displayed. Move the mouse away to cancel the prompt. The current time period is orange, which means it can be selected.
for(var i in mcode.minfo){ if(mcode.minfo[i].status===2){ html ='} else{ html =''; } else{ html ='mspan" >'; } html =mcode.minfo[i].time; if(mcode.minfo[i].status===2){ html ='} else if(mcode.minfo[i].status===3){ html =''; } if(mcode.minfo[i].status!==1){ html =''; } html =" span>"; }
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn