2011年11月13日 星期日

※視窗置中

<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
var win = null;
function newWindow(mypage,myname,w,h,features) {
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height='   h   ',';
  settings  = 'width='   w   ',';
  settings  = 'top='   wint   ',';
  settings  = 'left='   winl   ',';
  settings  = features;
  win = window.open(mypage,myname,settings);
  win.window.focus();
}
//  End -->
</script>
</HEAD>
<BODY>
<a href="#null" onClick="newWindow('http://連結網址','','650','250','resizable,scrollbars,status,toolbar')">連結文字</a>

修改說明:
1.650,跳出視窗寬度
2.250,跳出視窗高度
3.resizable,訪客可調整跳出視窗大小
4.scrollbars,跳出視窗上帶下拉轉軸
5.status,跳出視窗上帶狀態列
6.toolbar,跳出視窗上帶工具列
參考網址:http://blog.roodo.com/javamagic/archives/21271.html

沒有留言:

張貼留言