js代码:
window.onload = function (){
var oLi = document.getElementById("pl").getElementsByTagName("li");
var oUl=$("ul[class='test']");
for(var i = 0; i < oLi.length; i++){
oLi[i].index = i;
// oLi[i].onmouseover = function () {
oLi[i].onclick = function () {
for(var n = 0; n < oLi.length; n++) oLi[n].className="";
this.className = "current";
for(var n = 0; n < oUl.length; n++) oUl[n].style.display = "none";
oUl[this.index].style.display = "block";
}
}
}
字符串拼接插入方法:
$('#industry').append('
- '+createTime+'
'+newsDescription+'
');
阅读(1523) | 评论(0) | 转发(0) |