对象的困惑? 我是在学javascript,这是我看得不太看白的地方,2楼大哥 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title>Link Rollover</title> <script src="script04.js" language="javascript" type="text/javascript"></script></head><body bgcolor="#FFFFFF"> <h1><a href="next.html" id="arrow">Next page</a></h1> <img src="images/arrow_off.gif" width="147" height="82" id="arrowImg" alt="arrow" /></body></html>window.onload = rolloverInit;function rolloverInit() { for (var i=0; i<document.links.length; i++) { var linkObj = document.links[i]; if (linkObj.id) { var imgObj = document.getElementById(linkObj.id + "Img"); if (imgObj) { setupRollover(linkObj,imgObj); } } }}function setupRollover(thisLink,thisImage) { thisLink.imgToChange = thisImage; thisLink.onmouseout = rollOut; thisLink.onmouseover = rollOver; thisLink.outImage = new Image(); thisLink.outImage.src = thisImage.src; thisLink.overImage = new Image(); thisLink.overImage.src = "images/" + thisLink.id + "_on.gif";}function rollOver() { this.imgToChange.src = this.overImage.src;}function rollOut() { this.imgToChange.src = this.outImage.src;}这是翻转器的实现thisLink.outImage = new Image();这里看不明白,但又想到有个prototype也可以这样,两者不能分清楚的? 如何获取当前li上面最近的ul id值 大侠们帮我看看ExtJs在IE8下报错 如何用js在图片上绘制热点区域? js数组用key,value形式存储时,key的长度最大为? 以下代码,不能点击链接,什么原因? 怎样取得iframe内的html的对象值? 求删除下拉框选项的js语法。 如何获取选中图片上的坐标 一个非常简单的问题:怎么使程序终止执行???象VB里的END 等等的。。 js数组对比求解 高手帮看一个问题 快, 急....新手問題!!!!!!!!!!! 100分
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Link Rollover</title>
<script src="script04.js" language="javascript" type="text/javascript"></script>
</head>
<body bgcolor="#FFFFFF">
<h1><a href="next.html" id="arrow">Next page</a></h1>
<img src="images/arrow_off.gif" width="147" height="82" id="arrowImg" alt="arrow" />
</body>
</html>window.onload = rolloverInit;function rolloverInit() {
for (var i=0; i<document.links.length; i++) {
var linkObj = document.links[i];
if (linkObj.id) {
var imgObj = document.getElementById(linkObj.id + "Img");
if (imgObj) {
setupRollover(linkObj,imgObj);
}
}
}
}function setupRollover(thisLink,thisImage) {
thisLink.imgToChange = thisImage;
thisLink.onmouseout = rollOut;
thisLink.onmouseover = rollOver;
thisLink.outImage = new Image();
thisLink.outImage.src = thisImage.src; thisLink.overImage = new Image();
thisLink.overImage.src = "images/" + thisLink.id + "_on.gif";
}function rollOver() {
this.imgToChange.src = this.overImage.src;
}function rollOut() {
this.imgToChange.src = this.outImage.src;
}这是翻转器的实现
thisLink.outImage = new Image();
这里看不明白,但又想到有个prototype也可以这样,两者不能分清楚的?