Ten pięknie skonstruowany skrypt firmy CodeLifter.com pozwala wyświetlać efektowne okienko pop-up bez obramowań. Interpretuje go Internet Explorer 4 lub nowszy.
Gros treści skryptu znajduje się w ramach HEAD. Należy w nim zwrócić uwagę na nazwę wywoływanego okienka (tutaj: var urlPop = "framles2.htm"), rozmiary okienka (wide, heigh) i położenie lewego górnego rogu (from left, from top).
Przykładowa zawartość okienka pop-up została podana na końcu. Zauważ, że możesz zmieniać nie tylko treść, ale i manipulować stylami odpowiadającymi za kolorystykę okienka.
Skopiuj przykładowy kod (strona wywołująca).
W ramach HEAD
<script> // Amazing Frameless Popup Window - Version I // (C) 2000 www.CodeLifter.com // Free for all users, but leave in this header // set the popup window width and height var windowW=250 // wide var windowH=400 // high // set the screen position where the popup should appear var windowX = 250 // from left var windowY = 100 // from top // set the url of the page to show in the popup var urlPop = "framles2.htm" // set the title of the page var title = "Ważna wiadomość" // set this to true if the popup should close // upon leaving the launching page; else, false var autoclose = true // ============================ // do not edit below this line // ============================ s = "width="+windowW+",height="+windowH; var beIE = document.all?true:false function openFrameless(){ if (beIE){ NFW = window.open("","popFrameless","fullscreen,"+s) NFW.blur() window.focus() NFW.resizeTo(windowW,windowH) NFW.moveTo(windowX,windowY) var frameString=""+ "<html>"+ "<head>"+ "<title>"+title+"</title>"+ "</head>"+ "<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+ "<frame name='top' src='"+urlPop+"' scrolling=auto>"+ "<frame name='bottom' src='about:blank' scrolling='no'>"+ "</frameset>"+ "</html>" NFW.document.open(); NFW.document.write(frameString) NFW.document.close() } else { NFW=window.open(urlPop,"popFrameless","scrollbars,"+s) NFW.blur() window.focus() NFW.resizeTo(windowW,windowH) NFW.moveTo(windowX,windowY) } NFW.focus() if (autoclose){ window.onunload = function(){NFW.close()} } } </script>
W ramach BODY
<a href="javascript:openFrameless()">Kliknij tutaj</a>
Skopiuj przykładowy kod (wywoływane okienko - w naszym przykładzie plik frameles2.htm).
<html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-2"> <META NAME="robots" CONTENT="NOFOLLOW,NOINDEX"> <style> body{ border: 4px solid #987654; scrollbar-face-color:#a98765; scrollbar-shadow-color: #a98765; scrollbar-highlight-color:#a98765; scrollbar-3dlight-color: #a98765; scrollbar-darkshadow-color: #765432; scrollbar-track-color:#765432; scrollbar-arrow-color:#654321; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; } A.pFo:link {color:#a98765; text-decoration:overline;} A.pFo:visited {color:#a98765; text-decoration:overline;} A.pFo:active {color:#a98765; text-decoration:overline;} A.pFo:hover {color:#fedcba; text-decoration:overline;} </style> <title></title> </head> <body onload="top.window.focus()" bgcolor="#765432" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF" topmargin=0 leftmargin=0 marginwidth="0" marginheight="0" text="#FEDCBA"> <a class="pFo" href="javascript:parent.window.focus();top.window.close()">zamknij</a> <p>Tutaj jest jakaś treść strony.</p> <a class="pFo" href="javascript:parent.window.focus();top.window.close()">zamknij</a> </body> </html>