64、不同内容的文字链接

64、不同内容的文字链接

脚本说明:

把如下代码加入<body>区域中

<script language="JavaScript1.2">

var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1;

var ns6=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1;

var ns4=document.layers;

 

function showContent(content)

{

 if(ie4)

 {

  showContentObj=document.all.qiksearch_div;

 }

 if(ns6)

 {

  showContentObj=document.getElementById("qiksearch_div");

 }

 if(ie4||ns6)

 {

  if(showContentObj.innerHTML!=content)

  {

   showContentObj.innerHTML=content;

  }

  else

  {

   showContentObj.innerHTML="";

  }

 }

 if(ns4)

 {

  document.nsdiv.document.write(content);

  document.nsdiv.document.close();

 }

}

 

</script>

<center>

<a href="javascript:void(0);" onClick="javascript:showContent('<font face=verdana,arial,helvetica>This is Content 1</font>');"><font face="verdana,arial,helvetica" color="#CC0000" size="-1"><b>内容一</b></font></a> | <a href="javascript:void(0);" onClick="javascript:showContent('<font face=verdana,arial,helvetica>This is Content 2</font>');"><font face="verdana,arial,helvetica" color="#CC0000" size="-1"><b>内容二</b></font></a> | <a href="javascript:void(0);" onClick="javascript:showContent('<font face=verdana,arial,helvetica>This is Content 3</font>');"><font face="verdana,arial,helvetica" color="#CC0000" size="-1"><b>内容三</b></font></a>

<br><br><layer id="nsdiv" left="310"></layer>

<div id="qiksearch_div"></div></center>

 

 

Write a comment

Comments: 0