function SlideShow(c) {//由网页幻灯片底部执行函数参数1000 var a = document.getElementById("slideContainer"), f = document.getElementById("slidesImgs").getElementsByTagName("li"), h = document.getElementById("slideBar"), n = h.getElementsByTagName("li"), d = f.length, c = c || 3000, e = lastI = 0, j, m; function b() {//鼠标离开开始幻灯 m = setInterval(function () {//根据c规定的时间重复执行 e = e + 1 >= d ? e + 1 - d : e + 1;//第二圈的时候 e=0到d-1,第一圈从1开始的 g()//运行函数g }, c)//循环时间 } function k() { clearInterval(m)//鼠标悬停停止幻灯 } function g() {//图片切换 f[lastI].style.display = "none"; n[lastI].className = ""; f[e].style.display = "block"; n[e].className = "on"; lastI = e//lastI总在e的后面 } f[e].style.display = "block";//文档载入第一次e=0的时候 a.onmouseover = k;//鼠标悬停停止幻灯 a.onmouseout = b;//鼠标离开开始幻灯 h.onmouseover = function (i) { j = i ? i.target : window.event.srcElement; if (j.nodeName === "LI") { e = parseInt(j.innerHTML, 10) - 1; g() } }; b() } ;
代码地址:http://www.lanrentuku.com/js/jiaodiantu-985.html
最后面h.onmouseover 看不懂。。。不知道i的值是什么。。。