⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 images.js

📁 Javascript语言开发经典教程开发
💻 JS
字号:
// images.js

// Set image variables
var imgPath 	= 'images/';
var arrayHandles = new Array('out', 'over');

// Dynamically create image arrays
for (var i = 0; i < arrayHandles.length; i++) {
	eval('var ' + arrayHandles[i] + ' = new Array()');
	}

// Preload the images
for (var i = 0; i < imgNames.length; i++) {
	imagePreLoad(imgNames[i], i);
	}


// Define a function to preload the images
function imagePreLoad(imgName, idx) {
	for(var j = 0; j < arrayHandles.length; j++) {
		eval(arrayHandles[j] + "[" + idx + "] = new Image()");
		eval(arrayHandles[j] + "[" + idx + "].src = '" + imgPath + imgName + arrayHandles[j] + ".gif'");
		}
	}

// Perform the image rollovers
function imageSwap(imagePrefix, imageIndex, arrayIdx) {
	document[imagePrefix].src = eval(arrayHandles[arrayIdx] + "[" + imageIndex + "].src");
	}

// This function displays the text passed in the browser status bar
function display(stuff) { window.status = stuff; }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -