javascript+html实现
页面上有一副图像,在状态栏显示有关图像的说明。单击图像时,换成另一幅图像,同时状态栏的内容也做相应的...
页面上有一副图像,在状态栏显示有关图像的说明。单击图像时,换成另一幅图像,同时状态栏的内容也做相应的
展开
1个回答
展开全部
var s = 0;
var aSrc = Array();
var aInfo = Array();
i = 0;
aSrc[i] = "
"; aInfo[i] = "李多海一"; i++; aSrc[i] = "http://cimg.163.com/ent/2005/8/2/20050802141134d41d8.jpg"; aInfo[i] = "李多海二"; i++; aSrc[i] = "http://imgsrc.baidu.com/forum/pic/item/5e388a0a3e38533b95ca6bc2.jpg"; aInfo[i] = "李多海三"; i++; aSrc[i] = "http://img.ivsky.com/Photo/UploadFiles/2007-7-3/2007732126335.jpg"; aInfo[i] = "李多海四"; function setNextIndex() { var a = new Array(1, 2, 3, 0); s = a[s]; } function changeImg() { var img = document.getElementById("img1"); img.src = aSrc[s]; window.status = aInfo[s]; setNextIndex(); } changeImg();
"; aInfo[i] = "李多海一"; i++; aSrc[i] = "http://cimg.163.com/ent/2005/8/2/20050802141134d41d8.jpg"; aInfo[i] = "李多海二"; i++; aSrc[i] = "http://imgsrc.baidu.com/forum/pic/item/5e388a0a3e38533b95ca6bc2.jpg"; aInfo[i] = "李多海三"; i++; aSrc[i] = "http://img.ivsky.com/Photo/UploadFiles/2007-7-3/2007732126335.jpg"; aInfo[i] = "李多海四"; function setNextIndex() { var a = new Array(1, 2, 3, 0); s = a[s]; } function changeImg() { var img = document.getElementById("img1"); img.src = aSrc[s]; window.status = aInfo[s]; setNextIndex(); } changeImg();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询