我的代码是:
<div id="slider">
这是主要的div:
<div id="mainNews">
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<div class="newsInfo" id="news"& element style=" display:block"></div>
</ItemTemplate>
</asp:Repeater>
</div>
</div>
</div>
<script type="text/javascript" src="js/FirstSlider.js"></script>
JavaScript是:
var sliderTimeoutID;
var element = 1;
function delayedSlider() {
element == 5 ? element = 1 : element = element;
element == 1 ? pElement = 4 : pElement = element - 1;
document.getElementById("news" + pElement).style.display = "none";
document.getElementById("news" + element).style.display = "block";
document.getElementById("newsLink" + pElement).className = "newsLinks";
document.getElementById("newsLink" + element).className = "newsLinks selected";
sliderTimeoutID = window.setTimeout(delayedSlider, 6000);
element++;
}
delayedSlider();
我怎么称呼增量编号?