posts - 495,comments - 227,trackbacks - 0

<!--连接打开新窗口form-->
<FORM name="targetform">
<!--连接打开新窗口-->
<INPUT TYPE="checkbox" id="targetnew" NAME="targetnew" ONCLICK="hyperlinks(this.checked)" />
<label for="targetnew"><b>在新窗口中打开链接</b></label>
</form>
<!--连接打开新窗口脚本-->
<SCRIPT LANGUAGE="JavaScript">
<!--
//Enter "_blank" for new window (each time), "window2" for a set secondary window
var newwindow="_blank"

function hyperlinks(target){
   if (target) where = newwindow;
   else where = "_self";
   for (var i=0; i<=(document.links.length-1); i++){
   if (target && where!="_blank") //DynamicDrive.com added routine- open window in set secondary window
      document.links[i].onclick=function(){
  if (window.window2 && !window2.closed)
  window2.location=this.href
  else
         window2=window.open(this.href)
  window2.focus()
        return false
        }
   else{
      if (newwindow=="window2") document.links[i].onclick = "";   
      document.links[i].target = where;
       }
   }
}

function inithyperlinks(){    //DynamicDrive.com added routine
if (document.targetform.targetnew.checked)
hyperlinks(true)
}

window.onload=inithyperlinks;

// -->
</SCRIPT>

posted on 2006-09-14 17:23 SIMONE 阅读(3160) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: