36、弹出新窗口

36、弹出新窗口

<html>

<head>把下面的代码加在<body></body>

<script language="JavaScript">

<!--

 

var gt = unescape('%3e');

 

var popup = null;

 

var over = "Launch Pop-up Navigator";

 

popup = window.open('', 'popupnav', 'width=200,height=170,resizable=1,scrollbars=auto');

 

if (popup != null) {

 

if (popup.opener == null) {

 

popup.opener = self;

 

}

 

popup.location.href = '01.htm';

 

}

 

// -->

 

</script>

 

 

 

 

 

<title>隐藏格式的浮动层</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

</head>

<!-------------------------------->

<body onLoad="doAgilePopup()">

<script>

 

// Set the url of the banner popup window page

var theURL = "http://7stk.com";

 

// Set the title of the popup window

var title = "Goobers R Us"

 

// Set the size of the popup window

var windowWidth  = 478; // cannot be less than 100

var windowHeight = 100; // cannot be less than 100

 

// Set the position of the popup window

var windowX = 100;

var windowY = 100;

 

// Set true to auto-center (positions will be ignored)

var autocenter = false;

 

// Set true for popup to close when launch page does

var autoclose = false;

 

// Do not edit below this line.

// ============================

 

var s="width="+windowWidth+",height="+windowHeight;

var beIE=document.all?true:false;

var done=new Object("no");

 

if(autocenter){

windowX = (window.screen.width-windowWidth)/2;

windowY = (window.screen.height-windowHeight)/2;

}

 

function doAgilePopup(){

  if (beIE){

  agilePopper = window.open("","popAgile","fullscreen,"+s); 

  agilePopper.blur();

  window.focus();

  agilePopper.resizeTo(windowWidth,windowHeight);

  agilePopper.moveTo(windowX,windowY);

  var frameString=""+

"<html>"+

"<head>"+

"<title>"+title+"</title>"+

"</head>"+

"<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+

"<frame name='top' src='"+theURL+"' scrolling=no>"+

"<frame name='bottom' src='about:blank' scrolling='no'>"+

"</frameset>"+

"</html>"

  agilePopper.document.open();

  agilePopper.document.write(frameString);

  agilePopper.document.close();

  }else{

  agilePopper=window.open(theURL,"popAgile","scrollbars=no,"+s);

  agilePopper.blur();

  window.focus();

  agilePopper.resizeTo(windowWidth,windowHeight);

  agilePopper.moveTo(windowX,windowY);

  }  

  agilePopper.blur();

  if (autoclose){

  window.onunload = function(){agilePopper.close();}

  } 

  done="okay";

}

 

</script>

 

<!---------------------------------->

</body>

</html>

 

 

 

Write a comment

Comments: 1
  • #1

    i87i8 (Friday, 29 July 2011 02:25)

    6u776n