Home >Web Front-end >JS Tutorial >Three ways to display code in js full screen_javascript skills

Three ways to display code in js full screen_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:16:171324browse

The first method:
On an ordinary webpage that has been opened, click "Full Screen Display", and then enter the full screen mode corresponding to the webpage. The method is: add the following code between and on the web page:

Copy the code The code is as follows :





If the page displayed in full screen is not this page, you only need to replace document.location with the corresponding URL. That is, the following code:
Copy the code The code is as follows:


< ;input type=BUTTON name=FullScreen value=FullScreen onClick="window.open('URL address','big','fullscreen=yes')">


Second type:
When running a web page, for example, if you directly enter: http://localhost:8080/temp.jsp in the URL bar, the web page will be closed and a blank full screen will be displayed at the same time. Web page, the method is: write the following code in the body:
Copy the code The code is as follows:




Third Type:
It is actually a superposition of the above two types, and is generally used more often in this situation. That is, when you directly open a web page, you enter its full-screen mode. This situation is different from the first one, because in the first one, when you click the "Full Screen Display" button, it opens a new full-screen web page. , but the original ordinary web page is still there, so this one is better. The method is: create two jsp files, the first one only runs the following code, for example, the name is demo.jsp; the second one is the content you actually want to run, for example: temp.jsp:

demo.jsp:
Copy code The code is as follows:





temp.jsp:
Copy code The code is as follows:

<%@ page contentType= "text/html;charset=GB2312" language="java" %>


Here is my full-screen content. Look again, we are in the address bar Is the entered demo.jsp closed? OK, done!



Exit full screen
-------------------------- -------------------------------------------------- -------------------------------------------------- -----------------------------------------------

Regarding exiting full screen, I have searched a lot of information on the Internet. Generally speaking, it is difficult to achieve the desired goal. For example: we can add a hyperlink in a new window Open; you can also use the reverse method of opening full screen above. However, no matter how you do it, when you finally switch from full screen to normal mode, it is always equivalent to reopening a window. In this way, if you join our original full screen mode and play a movie, if you switch to normal mode, you have to reload. This definitely won't work. However, there is no other way. I will now refer to the reply on the 5th floor in this post: http://topic.csdn.net/t/20021028/12/1130882.html. With this method, I can generally get by. However, this method is not called full screen. It is equivalent to moving the window upward by a certain height. We can still drag the window. The code is as follows:
Copy the code The code is as follows:

<%@ page contentType="text/html;charset=GB2312" language="java" %>



Close page
------------------ -------------------------------------------------- -------------------------------------------------- --------------------------------------------------

If you want to close the page, you only need to add such a hyperlink to the page:
Copy the code The code is as follows :
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn