»
Tiếng AnhTiếng PhápTiếng Việt

In - Popup tự di chuyển và biến mất - JavaScriptBank.com

Phiên bản đầy đủ: jsB@nk » Trình duyệt » Cửa sổ » Popup tự di chuyển và biến mất
URL: https://www.javascriptbank.com/flying-pop-up-window-2.html

Popup tự di chuyển và biến mất © JavaScriptBank.comHiệu ứng tạo một cửa sổ popup với kích thước có thể thay đổi được ở đỉnh màn hình, cửa sổ này di chuyển theo chiều từ trái sang phải khi đến trung tâm thì dừng lại một khoảng thời gian ngắn rồi sau đó di chuyển tiếp sang phải và biến mất.

Phiên bản đầy đủ: jsB@nk » Trình duyệt » Cửa sổ » Popup tự di chuyển và biến mất
URL: https://www.javascriptbank.com/flying-pop-up-window-2.html



JavaScript
<SCRIPT><!-- Beginning of JavaScript -// Flying pop-up-window//  **********************************************************************************//  **********************************************************************************// INSTRUCTIONS: // Configure the variables below// The name of the pop-up-window. Do not change itvar popwindow// The height of the pop-up-window (pixels)var popwindowwidth=300// The width of the pop-up-window (pixels)var popwindowheight=180// Distance to the top margin of the big windowvar popwindowtop=20// The URL of the HTML-file that contains the content of the pop-up-windowvar popwindowURL="jsbankpopup.htm"// Standstill-time (seconds)var waitingtime=6// Configure ths speed of the pop-up-windowvar pause=20var step=40// Do not change this variablevar popwindowleft=-popwindowwidth-50// Do not change this variablevar marginright// Do not change this variablevar pagecenter// Do not change this variablevar timerwaitingtime= waitingtime*1000function showWindow() {popwindow = window.open(popwindowURL, "popwindow", "toolbar=no,width="+popwindowwidth+",height="+popwindowheight+",top="+popwindowtop+",left="+(-popwindowwidth)+"");if (document.all) {marginright = screen.width+50}if (document.layers) {marginright = screen.width+50}pagecenter=Math.floor(marginright/2)-Math.floor(popwindowwidth/2)movewindow()}function movewindow() {if (popwindowleft<=pagecenter) {popwindow.moveTo(popwindowleft,popwindowtop)popwindowleft+=steptimer= setTimeout("movewindow()",pause)}else {clearTimeout(timer)timer= setTimeout("movewindow2()",waitingtime)}}function movewindow2() {if (popwindowleft<=marginright) {popwindow.moveTo(popwindowleft,popwindowtop)popwindowleft+=steptimer= setTimeout("movewindow2()",pause)}else {clearTimeout(timer)popwindow.close()}}// --></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<BODY onload=showWindow()></BODY><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->