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

📄 0006.htm

📁 最全的JS大全,希望大家喜欢.收录于网络.收录于网络.最全的JS大全,希望大家喜欢.
💻 HTM
字号:
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- saved from url=(0032)http://www.ie-zone.com/index.php --><HTML><!-- #BeginTemplate "/Templates/JsExample.dwt" --><HEAD><!-- #BeginEditable "doctitle" --> <TITLE>动态图形转换 带Cookie </TITLE><!-- #EndEditable --><META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK  href="../fav.ico" rel="shortcut icon"><STYLE type=text/css>BODY {	MARGIN: 25px 25px 25px}#all TD {	FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体"}INPUT {	FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体"}SELECT {	FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体"}P {	FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体"}TEXTAREA {	FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体"}#all A:active {	COLOR: #7d070c}#all A:visited {	COLOR: #7d070c}#all A:hover {	COLOR: #336699}#all A:link {	COLOR: #7d070c}</STYLE><SCRIPT language=JavaScript><!--function MM_goToURL() { //v3.0  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");}function JM_cc(ob){ob.select();js=ob.createTextRange();js.execCommand("Copy");}//--></SCRIPT><META content="MSHTML 5.50.4134.600" name=GENERATOR></HEAD><BODY id=all text=#000000 bgColor=#336699><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>  <TR bgColor=#ffffff>     <TD><IMG src="../images/sq_1.gif" width=11 height="14"></TD>    <TD width="100%"></TD>    <TD><IMG src="../images/sq_2.gif"    width=11 height="14"></TD>  </TR></TABLE><!-- #BeginEditable "Example%20and%20Sources" --> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>  <TR bgColor=#ffffff>     <TD><IMG src="../images/space.gif" width=11 height="1"></TD>    <TD width="100%">      <table width="100%" border="0" cellpadding="8">        <tr>          <td align="center"><!-- #BeginLibraryItem "/Library/js_title.lbi" --><script language="JavaScript">document.write("<font color=#7d070c style=\"font-size: 14px\">"+document.title+"</font>");</script><!-- #EndLibraryItem --></td>        </tr>        <tr>          <td bgcolor="#f7f7f7">            <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 cookievar expdate = new Date ();FixCookieDate(expdate); expdate.setTime(expdate.getTime() + (5 * 60 * 1000)) // 5 minutes  //  initialize countimg variable to track imagescountimg = (GetCookie("countimg") != null) ? (GetCookie("countimg")-1) : -1countimg = (countimg <-1) ? -1 : countimgIMGArray = 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 stringselse {	IMGArray[0] = ""	IMGArray[1] = ""	IMGArray[2] = "" 						}IMGArray[0].src = "img/a01.gif"IMGArray[0].URL = "http://www.163.net"IMGArray[1].src = "img/a02.gif"IMGArray[1].URL = "http://www.163.com"IMGArray[2].src = "img/a03.gif"IMGArray[2].URL = "http://www.gznet.com"function updateIM(countimg) { return countimg; }//  functions for onMouseOver, onMouseOut, onClick event handlersfunction 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 functionfunction 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, onloadfunction getIt2() { 	countimg = (GetCookie("countimg") != null) ? (GetCookie("countimg")) : 0	updateIM(countimg)	if (exbannerID != null) { clearTimeout(exbannerID); showIMAGE() }}function initCOOKIES() {window.onunload = setIt2window.onfocus = getIt2window.onblur = setIt2 	}function initBANNER() {		showIMAGE() 	cookieID = setTimeout("initCOOKIES()",1000) }window.onload = initBANNER// --></script>            提示: 看下面的图形,会自动变换,共有三张循环,每张图片的链接地址都不同。并通过Cookie记住某图片是否已显示。<br><a href="" onClick="clickhref2()" onMouseOver="Overhref2();return true;" onMouseOut="Outhref2;return true;"><img src="" name="banner" border="0" ></a>           </td>        </tr>      </table>    1.将下面的代码放到&lt;body&gt;或&lt;head&gt;内       <input type="button" name="Button" value="复制代码到我的剪贴板" onClick=JM_cc(js_1)>      <br>      <textarea name="js_1" cols="80" rows="10" wrap="VIRTUAL">             <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 cookievar expdate = new Date ();FixCookieDate(expdate); expdate.setTime(expdate.getTime() + (5 * 60 * 1000)) // 5 minutes  //  initialize countimg variable to track imagescountimg = (GetCookie("countimg") != null) ? (GetCookie("countimg")-1) : -1countimg = (countimg <-1) ? -1 : countimgIMGArray = 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 stringselse {	IMGArray[0] = ""	IMGArray[1] = ""	IMGArray[2] = "" 						}IMGArray[0].src = "http://www.ie-zone.com/banners/a01.gif"IMGArray[0].URL = "http://www.163.net"IMGArray[1].src = "http://www.ie-zone.com/banners/a02.gif"IMGArray[1].URL = "http://www.163.com"IMGArray[2].src = "http://www.ie-zone.com/banners/a03.gif"IMGArray[2].URL = "http://www.gznet.com"function updateIM(countimg) { return countimg; }//  functions for onMouseOver, onMouseOut, onClick event handlersfunction 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 functionfunction 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, onloadfunction getIt2() { 	countimg = (GetCookie("countimg") != null) ? (GetCookie("countimg")) : 0	updateIM(countimg)	if (exbannerID != null) { clearTimeout(exbannerID); showIMAGE() }}function initCOOKIES() {window.onunload = setIt2window.onfocus = getIt2window.onblur = setIt2 	}function initBANNER() {		showIMAGE() 	cookieID = setTimeout("initCOOKIES()",1000) }window.onload = initBANNER// --></script></textarea>      <br>      <br>      2.修改Script中的图片路径与连接网址<br>      IMGArray[0].src = &quot;<font color="#990000">http://www.ie-zone.com/banners/a01.gif</font>&quot;<br>      IMGArray[0].URL = &quot;http://www.163.net&quot;<br>      IMGArray[1].src = &quot;<font color="#990000">http://www.ie-zone.com/banners/a02.gif</font>&quot;<br>      IMGArray[1].URL = &quot;http://www.163.com&quot;<br>      IMGArray[2].src = &quot;<font color="#990000">http://www.ie-zone.com/banners/a03.gif</font>&quot;<br>      IMGArray[2].URL = &quot;http://www.gznet.com&quot;<br>      <br>      3. 在需要加入变换效果的地方加上 <br>      &lt;a href=&quot;&quot; onClick=&quot;clickhref2()&quot; onMouseOver=&quot;Overhref2();return       true;&quot; onMouseOut=&quot;Outhref2;return true;&quot;&gt;&lt;img src=&quot;&quot;       name=&quot;banner&quot; border=&quot;0&quot; &gt;&lt;/a&gt; <br>      <br>    </TD>    <TD><IMG src="../images/space.gif"    width=11 height="1"></TD>  </TR></TABLE><!-- #EndEditable --><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>  <TR bgColor=#ffffff>     <TD><IMG src="../images/sq_3.gif" width=11 height="14"></TD>    <TD width="100%"></TD>    <TD><IMG src="../images/sq_4.gif"    width=11 height="14"></TD>  </TR></TABLE></BODY><!-- #EndTemplate --></HTML>

⌨️ 快捷键说明

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