Skip navigation.
Home

window.open

  1. <script type="text/javascript" language="javascript">
  2. function popUpWindow(sURL, sName, width, height, menu, resize, scrollbar, status, title, toolbar)
  3. {
  4.         // Detect Default Value
  5.         menu = typeof(menu) == 'undefined'?0:menu;
  6.         resize = typeof(resize) == 'undefined'?0:resize;
  7.         scrollbar = typeof(scrollbar) == 'undefined'?0:scrollbar;
  8.         status = typeof(status) == 'undefined'?0:status;
  9.         title = typeof(title) == 'undefined'?0:title;
  10.         toolbar = typeof(toolbar) == 'undefined'?0:toolbar;
  11.         ////////////////////////////////////////////////////////////////
  12.        
  13.         screenwidth = window.screen.width;
  14.         screenheight = window.screen.height;
  15.        
  16.         var left = (screenwidth/2) - (width/2);
  17.         var top = (screenheight/2) - (height/2);
  18.        
  19.         var newwin = window.open(sURL, sName, "top=" + top + ", left=" + left + ", height="+ height + ", width=" + width + ", menubar=" + menu + ", resizable=" + resize + ", scrollbars=" + scrollbar + ", status=" + status + ", titlebar=" + title + ", toolbar=" + toolbar + "");
  20.         newwin.focus();
  21. }
  22. </script>

เอาไว้เปิดหน้าใหม่

Your rating: None Average: 2.9 (8 votes)