演
示
源
代
码
<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 = "
" IMGArray[0].URL = "
" IMGArray[1].src = "
" IMGArray[1].URL = "
" IMGArray[2].src = "
" IMGArray[2].URL = "
" 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()",2500) }} 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> <a href="" onClick="clickhref2()" onMouseOver="Overhref2();return true;" onMouseOut="Outhref2;return true;"><img src="" name="banner" border="0" ></a>
变换图形
图形一的文件名:
链接地址 http :
图形二的文件名:
链接地址 http :
图形三的文件名:
链接地址 http :
注释:放在<body>与</body>之间
当前位置:
首 页
→
JavaScript
→
图形特效
→变换图形
··万旭网站工作室 设计发布··