我想给自己写的导航代码加 自动换到下一个链接的代码 本帖最后由 jayhai 于 2011-08-16 23:52:35 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 跟图片的延迟加载一样jquery已经提供了相关的函数了 我就只想用javascript完成 功能 无需其他的ajax jquery什么的 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><script type="text/javascript" defer="defer">var s;function i1(s){ document.getElementById("imggg").setAttribute('s',s); document.getElementById("imggg").src="http://yzz.web.officelive.com/1.jpg"; } function i2(s){ document.getElementById("imggg").setAttribute('s',s); document.getElementById("imggg").src="http://yzz.web.officelive.com/2.jpg"; } function i3(s){ document.getElementById("imggg").setAttribute('s',s); document.getElementById("imggg").src="http://yzz.web.officelive.com/3.jpg"; }function i4(s){ document.getElementById("imggg").setAttribute('s',s); document.getElementById("imggg").src="http://yzz.web.officelive.com/4.jpg"; } function i5(s){ document.getElementById("imggg").setAttribute('s',s); document.getElementById("imggg").src="http://yzz.web.officelive.com/5.jpg"; } function ddd(){ var s = document.getElementById("imggg").getAttribute('s'); window.open(s); }</script></head><body><table width="212" border="0" cellspacing="0"> <tr> <td><img id="imggg" src="http://yzz.web.officelive.com/1.jpg" width="220" onclick="ddd();" height="141" /></td> </tr> <tr> <td><a id="img1" href="#" onclick="i1('http://www.baidu.com/');">1</a> <a id="img2" href="#" onclick="i2('http://www.163.com/');">2</a> <a href="#" onclick="i3('http://www.ali213.net')">3</a> <a href="#" onclick="i4('http://www.library.hn.cn/')">4</a> <a href="#" onclick="i5('http://www.gougou.com')">5</a></td> </tr></table></body></html> 参考此网站啊 不用点击 链接自动切换 点击也可切换 bbs.a9vg.com 左上角 问个ext.data.store的问题 iframe的使用 正则表达式?? 用JS如何读取按钮上的值? IE7预览图片 iframe如何跨域自适应? 右击弹出窗口事件 【捉急吖】在对象引用的过程中如何使用变量? Google Map API 函数回调问题 ext中treenode点击事件 100分 每日一问,以示存在 IE6下jQuery alert值
jquery已经提供了相关的函数了
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" defer="defer">var s;function i1(s){
document.getElementById("imggg").setAttribute('s',s);
document.getElementById("imggg").src="http://yzz.web.officelive.com/1.jpg";
}
function i2(s){
document.getElementById("imggg").setAttribute('s',s);
document.getElementById("imggg").src="http://yzz.web.officelive.com/2.jpg";
} function i3(s){
document.getElementById("imggg").setAttribute('s',s);
document.getElementById("imggg").src="http://yzz.web.officelive.com/3.jpg";
}function i4(s){
document.getElementById("imggg").setAttribute('s',s);
document.getElementById("imggg").src="http://yzz.web.officelive.com/4.jpg";
}
function i5(s){
document.getElementById("imggg").setAttribute('s',s);
document.getElementById("imggg").src="http://yzz.web.officelive.com/5.jpg";
} function ddd(){
var s = document.getElementById("imggg").getAttribute('s');
window.open(s);
}
</script>
</head><body>
<table width="212" border="0" cellspacing="0">
<tr>
<td><img id="imggg" src="http://yzz.web.officelive.com/1.jpg" width="220" onclick="ddd();" height="141" /></td>
</tr>
<tr>
<td><a id="img1" href="#" onclick="i1('http://www.baidu.com/');">1</a> <a id="img2" href="#" onclick="i2('http://www.163.com/');">2</a> <a href="#" onclick="i3('http://www.ali213.net')">3</a> <a href="#" onclick="i4('http://www.library.hn.cn/')">4</a> <a href="#" onclick="i5('http://www.gougou.com')">5</a></td>
</tr>
</table></body>
</html>