我正在创建一个广播电台网站。我想要做的是改变当前节目播出的“缩略图”,并改变即将到来的2节目的文字和时间。我已经在网上查了一些我理解的代码。我修改了它,但现在我遇到了挑战;
这是我的代码;
var rightNow = new Date();
var day = rightNow.getDay();
var hour = rightNow.getHours();
var minute = rightNow.getMinutes();
var onAir = document.getElementsByClassName("onAirThumbnail");
var nextShow = document.getElementsByClassName("nextHost");
var nextTime = document.getElementsByClassName("nextTime");
var followingShow = document.getElementsByClassName("followingHost");
var followingTime = document.getElementsByClassName("followingTime");
if (day === 6) {
if ((hour == 13 && minute >= 0) || (hour == 15 && minute <= 59)) {
$(onAir).src = "../img/urban_top_30.jpg";
$(nextShow).innerHTML = "The Pass Out";
$(nextTime).innerHTML = "13h00";
$(followingShow).innerHTML = "The Plug Point";
$(followingTime).innerHTML = "16h00";
}
}
<div class="row">
<div id="stream">
<h7 class="onAir"><strong>ON AIR</strong></h7><br>
<img src="img/jam-avenue.jpg" onload="this.width/=2.5;" class="onAirThumbnail"><br>
<button type="button" class="btn btn-danger">LISTEN LIVE</button><br>
<div id="upNextTable">
<table class="table table-hover">
<thead>
<tr>
<th><h8><strong>UP NEXT</strong></h8></th>
</tr>
</thead>
<tbody>
<tr>
<td class="nextHost">Joey Drumz</td>
<td class="nextTime">22h00</td>
</tr>
<tr>
<td class="followingHost">The First Impresssion</td>
<td class="followingTime">01h00</td>
</tr>
</tbody><!-- end table body -->
</table><!-- end table -->
</div><!-- end table div -->
</div><!-- end stream div -->
</div><!-- end div row -->
我知道这有很多问题,所以我请求有耐心和愿意分享他们知识的人帮助我。