我想把一个js焦点图切换出来的文字改成图片!

<scripttype="text/javascript">functionAdItem(name,phone,address,Photo,price,time,url)... <script type="text/javascript">
function AdItem(name,phone,address,Photo,price,time,url) {
this.name = name;
this.phone = phone;
this.address = address;
this.Photo = Photo;
this.url = url;
this.price = price;
this.time = time;
}
var ad = new Array();
ad[0] = new AdItem('','2','','images/1.jpg','#');ad[1] = new AdItem('','','','images/2.jpg','#');ad[2] = new AdItem('','','','images/3.jpg','#');ad[3] = new AdItem('','','','images/4.jpg','#');ad[4] = new AdItem('','','','images/5.jpg','#');ad[5] = new AdItem('','','','images/6.jpg','#'); ;
var img = new Array();
img[0] = document.getElementById("imgSmallLeft");
img[1] = document.getElementById("imgMiddleLeft");
img[2] = document.getElementById("imgBig");
img[3] = document.getElementById("imgMiddleRight");
img[4] = document.getElementById("imgSmallRight");
img[5] = document.getElementById("imgHidden");

var position = 0;
for(i=0;i<img.length;i++){
img[i].src = ad[i].Photo;
}

var adname = document.getElementById("adname").src="images/1.jpg";
var adtel = document.getElementById("adtel");
var adaddr = document.getElementById("adaddr");
var adprice = document.getElementById("adprice");
var adtime = document.getElementById("adtime");

var cur = 2;
adname.href = ad[2].url;
if(navigator.userAgent.indexOf("Firefox")>0){
adname.textContent = ad[2].name;
adtel.textContent = ad[2].phone;
adaddr.textContent = ad[2].address;
adprice.textContent = ad[2].price;
adtime.textContent = ad[2].time;
} else {
adname.innerText = ad[2].name;
adtel.innerText = ad[2].phone;
adaddr.innerText = ad[2].address;
adprice.innerText = ad[2].price;
adtime.innerText = ad[2].time;
}
</script>
这里是js代码
展开
 我来答
匿名用户
2012-04-24
展开全部
试试这个图片切换
有12345数字一起切换
鼠标点一下数字会变换到另一张图片,不点就会自动换
里面有教程和源码

参考资料: http://www.blueidea.com/common/shoutbox/redir.asp?2=p&id=10895

已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式