Learn how to make Web pages: the creation of a borderless window

Source: Internet
Author: User
Tags object exit window
Tips | Web page

First you have to do an index page, which is the page you want to open first, such as index.htm

This page does not need any content, his role is to create a frame-free page and then slide it into the page, and then close their own index page, as long as the page in the <body> add the following code:

<!--Hhctrl Object-->
<object id= "CloseWindow" type= "Application/x-oleobject" classid= "Clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" >
<param name= "Command" value= "Close" >
</object>
<script>
var w=640,h=420;
var xpos=0,ypos=0,targetx= (screen.width-w)/2,targety= (screen.height-h)/2;
function Go ()
{
if (targetx-xpos>1)
{xpos= (Targetx+9*xpos)/10;
Popup.moveto (xpos,targety); }
Else
{cleartimeout (mm);
This.focus ();
Closewindow.click (); }
Mm=settimeout ("Go ()", 10);
}
Self.moveto ( -2222,-2222);
var appname=navigator.appname;
Judge not Netscape,opera or Tencent Explorer
if (Appname.indexof (' Microsoft ')!=-1 && document.body.clienttop==2 && window.external.x!= ' wibble ')
{
var popup=window.open (' winmove.htm ', ', ', ' fullscreen=1 ');
Popup.moveto ( -1800,targety);
Popup.resizeto (W,H);
SetTimeout ("Go ()", 500);
}
Else
{Alert ("Please use IE5.0 or the above version to browse, thank you!");}
</script>

Here, the effect of sliding into the OK, now say slide out, beginning I thought in the closed window of the * * Javascript:close () can be closed to slide out, but found only close, but is not sliding out of the closed, then know that this requires a script to do

The code is as follows, adding this code to the reference page, which is the winmove.htm of this example here:

<script>
var w=640,h=420;
var xstep=0,targetx= (screen.width-w)/2,targety= (screen.height-h)/2;
function exit ()
{
if (xstep+targetx<screen.width)
{xstep=0.1+xstep*2;
Window.moveto (targetx+xstep,targety); }
Else
{cleartimeout (MO);
Window.close (); }
Mo=settimeout ("Exit ()", 10);
}
</script>

Then do this on the * * Picture of the Closing window:

Minimize picture Link Code

Minimized script

<object id= "Hhctrl" type= "Application/x-oleobject" classid= "Clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" >
<param name= "Command" value= "Minimize" >
</object>
<script>
<!--
function min () {
This.focus (); Hhctrl.click (); }
-->
</script>

The last thing to say is winmove this page to define the CSS, the page of the scroll bar definition is not, otherwise there will be no frame page with a scroll bar

<style type= "Text/css" >
<!--
Body {Overflow:hidden}
-->
</style>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.