Javascript full-screen display issues
Related Tags:
Back to a fixed page:
Function bk (strUrl)
(
Window.location.href = strUrl
)
Bk ( "A.jsp")
Full-screen on the open pages
<SCRIPT LANGUAGE="JavaScript">
<! - Begin
If (this.name! = 'Fullscreen') (
Window.open (location.href, 'fullscreen', 'fullscreen, scrollbars')
)
/ / End ->
</ Script>
<a Href="JavaScript:window.close(self)"> return to normal results show </ a>
<script LANGUAGE="JavaScript">
<! --
Window.open ( "URL (such as http://www.webjx.com)," "(window) in 123", "height = 170, Width = 300, toolbar = no, menubar = no, scrollbars = no, resizable = no, location = no, status = no, top = 100 ");
//-->
</ Script>
Note:
url address on behalf of the pop-up window
Height of the high representative of the pop-up window
Width on behalf of the width of a pop-up window
Toolbar on behalf of the toolbar, no had no toolbars, yes for the toolbar
Menubar behalf of the menu bar, no menu indicated that he did not show, users can also yes
Scrollbars representatives of the rolling, rolling, that there is no no, yes for scrolling, but also can be used auto
Representatives can zoom resizable pop-up window
Location representative of the address bar
Status on behalf of off-state column
Top representatives from the browser window from the top of
JavaScript: fault-tolerant and fully maximize the browser automatically
Error code dealing with the immediate establishment of JavaScript code we sometimes the result of our negligence, there are some mistakes, so that users will be browsing is annoying pop-up error messages framework for how to deal with such a situation? Here are two common methods:
(1) fully fault-tolerant
That the users to browse the pages containing the error code, ignore all the mistakes. Code as follows:
;
<script>
Function killerr () (
Return true
)
Window.onerror = killerr
</ Script>
Although it can cover up the errors, mistakes to avoid pop-up boxes, but has yet to correct implementation procedures, another approach is presented below.
(2) Feedback wrong message
That is, when an error code, we pre-designed automatic pop-up window good feedback to users simply click the mouse on the feedback information can be sent to designated mailboxes you, of course, the content of our feedback window can be modified Design. Code as follows:
<script>
Function errorinfo ()
(
Errorwin = window.open ( "", "", "width = 20, height = 120")
Errorwin.document.write ( '<title> script error report </ title> <center> the pages of the script that operational errors, please <a href = "mailto: lhy@cenpok.net"> notice </ a>
Administrator. <br> <form> <Input type = "button" value = "Close Window" onCli
Ck = "window.close ()"></ form> </ center> ')
Errorwin.document.close ()
Errorwin.document.bgColor = "# ffffff"
Return true
)
Window.onerror = errorinfo
</ Script>
Optimization browser window
Use this code when the user opens your page, the browser window will be automatically extended to the maximum use of space (full-screen), is not very professional?
The following code on <head> </ head> between:
<script Language="JavaScript">
<! - Function winfix () (
If (document.layers) (
Width = screen.availWidth-10;
Height = screen.availHeight-20;
Else ()
Var width = screen.availWidth-2;
Var height = screen.availHeight;
)
Self.resizeTo (width, height);
Self.moveTo (0, 0);
)
//-->
</ Script>
The following code on the <body> Tag Lane:
<body Onload="winfix()">
<script Language="javascript">
/ / Resize_Window
If ((screen.width == 1024) & & (screen.height == 768)) (
Resize_WindowX = 1024;
Resize_WindowY = 768;
Self.resizeTo (Resize_WindowX, Resize_WindowY); / / Resize_WindowEnd
)
Else ((screen.width> 1024) & & (screen.height> 1000)) (
Document.body.clientWidth = 1280;
Document.body.clientHeight = 1024;
Self.resizeTo (document.body.clientWidth, document.body.clientHeight); / / Resize_WindowEnd
)
Document.body.clientWidth; document.body.clientHeight
</ Script>
<script Language="javascript">
<! - Begin
If ((screen.width == 640) & & (screen.height == 480)) (
* 480.htm self.location.href ='640 '
)
Else if ((screen.width == 800) & & (screen.height == 600)) (
* 600.htm self.location.href ='800 '
)
Else if ((screen.width == 1024) & & (screen.height == 768)) (
* 768.htm self.location.href ='1024 '
)
Else (self.location.href = 'else.htm'
)
/ / End ->
</ Script>
Window.openr opened by the father of the window operation with the framework is not the same as the father of windows and window between the opener to contact. The visit of the source window to window to pass its handle to operate. Following small examples that can help beginners a better understanding of their operation.
Test.htm
<html>
<head>
<meta Http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta Name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta Name="ProgId" content="FrontPage.Editor.Document">
<title> Father window of the operation of </ title>
</ Head>
<body>
<script>
Var win = null;
Function op () (
Win = window.open ( "about: blank", "win", "width = 200, height = 200");
Win.document.write ( "<input type='button' value='关闭父窗口' onclick='window.opener.opener=null;window.opener.close()'>");
Win.document.write ( "<input type='button' value='刷新你窗口' onclick='window.opener.location.reload()'>");
)
</ Script>
<input Onclick="op()" value="打开窗口" type="button"> <input type = "button" value = "minimize" onclick = "if (win win.open & & & &! Win.closed) (win. resizeTo (0,0); win.moveTo (0, window.screen.width);) else alert ( 'still not been opened or have been closed window')">< input type = "button" value = "maximize" onclick = "if (win win.open & & & &! win.closed) (win.moveTo (-4, -4); win.resizeTo (screen.availWidth 8, screen.availHeight 8);) else alert ( 'no open windows or have Close');">< input type = button value = "closed-window" onclick = "if (win win.open & & & &! win.closed) (win.opener = null; win.close ()) else alert ( 'not open windows or closed')">< input type = button value = "Refresh-window" onclick = "if (win win.open & & & &! win.closed) (win.location.reload (); win.focus ()) else alert ( 'window has not opened or closed')">< input type = "button" value = "window view of the size of" onclick = "if (win win.open & & & &! win.closed) (alert (win.document. body.clientWidth '*' win.document.body.clientHeight); win.focus ();) else (alert ( 'still not been opened or have been closed window')};">
</ Body>
</ Html>
Website showed a certain period of time to shut down automatically
<script Id=clientEventHandlersJS language=javascript>
Window.opener = null;
</ Script>
<body Bgcolor="#fef4d9" onLoad="setTimeout(window.close, 5000)">
<html>
<Head
<title> 123 </ title>
<meta Http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
<! --
Function omiga_window () (
Window.open ( "full_window.htm ",""," fullscreen, scrollbars")
)
//-->
</ Script>
</ Head>
<body Onload="omiga_window()" onblur="focus();closes.Click();" scroll="no">
<object Id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param Name="Command" value="Close">
</ Object>
<p> </ P>
<p> </ P>
Full screen!
</ Body>
</ Html>
<script Language="JavaScript">
<! - Function winfix () (
If (document.layers) (
Width = screen.availWidth-10;
Height = screen.availHeight-20;
Else ()
Var width = screen.availWidth-2;
Var height = screen.availHeight;
)
Self.resizeTo (width, height);
Self.moveTo (0, 0);
)
//-->
</ Script>
- Div accelerate the use of the display pages
- Fireworks display map clips effect
- Display hidden div
- CSS display, in which visibility and distinction?
- Display: inline-block attributes
- Javascript full-screen display issues
- On display: inline with float: left; awareness
- CSS properties and Visibility Display
- CSS display property Senior Guide
- Google AdSense advertising display
- LRC display lyrics flash Principle
- CSS in IE and Nascape display differences
- Alexa Toolbar in your logo on display
- Different resolution display different connection
- Javascript control with the display and hidden div
- Javascript control DIV display
- On display: inline with the float: left correct understanding of the meaning of!
- Fireworks display physical production
- Novel and practical effect of the display picture
- CSS in-depth understanding of the display: inline-block attributes




