如果我理解正确,您需要一个与当前时间相关的发车视觉指示器。
一种解决方案是使用Javascript,并提供一种将元素标识为已通过或活动计划时间的方法。
HTML
<div id="myElement">
<a href="https://myawesomenewsite.com/departuretime/1253">1253</a>
<a href="https://myawesomenewsite.com/departuretime/1255">1255</a>
<a href="https://myawesomenewsite.com/departuretime/0955">0955</a>
<a href="https://myawesomenewsite.com/departuretime/2213">2213</a>
</div>
JAVASCRIPT
// find elements
var rootElements = $("#myElement a");
rootElements.each(function(index, item){
var url = item.href,
arr_split = url.split("/"),
arr_index = arr_split.length-1,
departureTime = arr_split[arr_index],
date = new Date(),
myTime = date.getHours()+\'\'+date.getMinutes();
//add your class like this
item.classList.add(myTime);
//but you can also spice it up a bit
if(departureTime>myTime){
item.classList.add("you_have_time");
}else{
item.classList.add("you_dont_have_time");
}
});
CSS
.you_have_time{
color:green;
}
.you_dont_have_time{
color:red;
}
当然还有
jsfiddle