你们好!我请教个问题!!关于带连接的自动变化图片的问题
这个代码是我在网上找的,很多站都转载的这个:我更改了图片的连接后上传后运行点击连接没反应!!!!连接修改在下面.问题地址在:http:// 点击大图象没有反应,请各位帮看下谢谢你们!
<script language="JavaScript">
<!--
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr)); }
function FixCookieDate (date) {
var base = new Date(0);
var skew = base.getTime(); // dawn of (Unix) time - should be 0
if (skew > 0) // Except on the Mac - ahead of its time
date.setTime (date.getTime() - skew); }
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break; }
return null; }
// assign expiration date variable for cookie
var expdate = new Date ();
FixCookieDate(expdate);
expdate.setTime(expdate.getTime() + (5 * 60 * 1000)) // 5 minutes
// initialize countimg variable to track images
countimg = (GetCookie("countimg") != null) ? (GetCookie("countimg")-1) : -1
countimg = (countimg <-1) ? -1 : countimg
IMGArray = new Array(3)
if (document.images) {
IMGArray[0] = new Image(205,56)
IMGArray[1] = new Image(205,56)
IMGArray[2] = new Image(205,56) }
// Old browsers get an array of empty strings
else {
IMGArray[0] = ""
IMGArray[1] = ""
IMGArray[2] = "" }
<!-- 改变下面的三个图像的地址及相应的链接地址-->
IMGArray[0].src = "image/fenhong.jpg"
IMGArray[0].URL = "http://
IMGArray[1].src = "image/xinfuaa.jpg"
IMGArray[1].URL = "http://
IMGArray[2].src = "image/jiliaa.jpg"
IMGArray[2].URL = "http://
function updateIM(countimg) { return countimg; }
// functions for onMouseOver, onMouseOut, onClick event handlers
function Overhref2() { updateIM(countimg)
if (IMGArray[countimg] != null ) {
window.status = IMGArray[countimg].URL; return true; }}
function Outhref2() { window.status = ""; return true; }
function clickhref2() { updateIM(countimg)
if (IMGArray[countimg] != null ) {
location = IMGArray[countimg].URL }}
// Image swapping function
function showIMAGE() { updateIM(countimg++)
if (document.images) {
// Make sure countimg does'nt get too big
if ( countimg > IMGArray.length - 1 ) { countimg = IMGArray.length - IMGArray.length }
document.images.banner.src = IMGArray[countimg].src
exbannerID = setTimeout("showIMAGE()",6500) }}
function setIt2() { updateIM(countimg)
document.cookie = "countimg=" + countimg + "; expires=" + expdate.toGMTString() }
// get cookie countimg onblur, onload
function getIt2() {
countimg = (GetCookie("countimg") != null) ? (GetCookie("countimg")) : 0
updateIM(countimg)
if (exbannerID != null) { clearTimeout(exbannerID); showIMAGE() }}
function initCOOKIES() {
window.onunload = setIt2
window.onfocus = getIt2
window.onblur = setIt2 }
function initBANNER() {
showIMAGE()
cookieID = setTimeout("initCOOKIES()",1000) }
window.onload = initBANNER
// -->
</script>