//显示
imageslide.prototype.display = function () {
var boxstr = "<div style='width:" + this.width + "px;height:" + this.height + "px;' ";
boxstr += "id='" + this.boxid + "'><div ";
if (this.autoplay)
boxstr += "onclick='window.imageslide.play();window.imageslide.timerplay();'";
else
boxstr += "onclick='window.imageslide.play();'";
boxstr += "style='word-break:keep-all;width:100%;height:100%;background-color:#eeeeee;'>";
if (this.autoplay)
boxstr += "<br /> 点击此处开始进行自动播放……";
else
boxstr += "<br /> 点击此处开始播放,播放时单击播放下一张……";
boxstr += "</div>";
var img;
var transform = this.transform;
for (var i = 0; i < this.imgs.length; i++) {
if (this.transform >= 23)
var transform = math.floor(math.random()*23);
boxstr += "<img src='" + this.imgs[i] + "' style='display:none;width:";
boxstr += this.width + ";height:" + this.height + "px;height:px;filter:";
boxstr += "revealtrans(transition=" + transform + ",duration=1);'";
if (!this.autoplay)
boxstr += "' onclick='window.imageslide.play();' alt='点击播放下一张'";
boxstr += " />";
}
boxstr += "</div>";
document.writeln(boxstr);
var box = document.getelementbyid(this.boxid);
this.first = box.childnodes[0];
this.frms = box.getelementsbytagname("img");
}
//播放
imageslide.prototype.play = function () {
if (window.imageslide.imgs.length) {
window.imageslide.first.style.display = "none";
if (window.imageslide.count >= window.imageslide.imgs.length) {
alert("播放完毕!");
window.imageslide.frms[window.imageslide.count-1].style.display = "none";
window.imageslide.first.style.display = "block";
window.imageslide.first.innerhtml = "<br /> 点击此处再次进行播放!";
clearinterval(window.imageslide.timer);
window.imageslide.count = 0;
}
else if (window.imageslide.count == 0) {
window.imageslide.first.style.display = "none";
window.imageslide.frms[0].filters[0].apply();
window.imageslide.frms[0].style.display = "block";
window.imageslide.frms[0].filters[0].play();
}
else {
window.imageslide.frms[window.imageslide.count-1].style.display = "none";
window.imageslide.frms[window.imageslide.count].filters[0].apply();
window.imageslide.frms[window.imageslide.count].style.display = "block";
window.imageslide.frms[window.imageslide.count].filters[0].play();
}
window.imageslide.count++;
}
else {
alert("你没有放入任何图片,无法进行播放!");
}
}
//连续播放
imageslide.prototype.timerplay = function () {
this.timer = setinterval(this.play, this.delay * 1000);
}