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

In - Popup di chuyển quanh màn hình - JavaScriptBank.com

Phiên bản đầy đủ: jsB@nk » Trình duyệt » Cửa sổ » Popup di chuyển quanh màn hình
URL: https://www.javascriptbank.com/flying-border-popup.html

Popup di chuyển quanh màn hình © JavaScriptBank.comHiệu ứng tạo một cửa sổ popup với kích thước có thể thay đổi được ở góc trái-trên của trình duyệt, cửa sổ này di chuyển theo chiều từ trên xuống, rồi từ trái sang phải, từ dưới lên và phải sang trái để trở về vị trí ban đầu.

Phiên bản đầy đủ: jsB@nk » Trình duyệt » Cửa sổ » Popup di chuyển quanh màn hình
URL: https://www.javascriptbank.com/flying-border-popup.html



JavaScript
<SCRIPT>// Flying Border Popup// Author: Peter Gehrig // Web Site: http://www.24fun.com var popwindowvar tisurlvar tiswidthvar tisheightvar thismargin=10var tistopposition=thismarginvar tisleftposition=thismarginvar pause=20var step=20var screenwidthvar screenheightvar endposition_xvar endposition_yvar timerfunction openpopup(thisurl,thiswidth,thisheight) {tisurl=thisurltiswidth=thiswidthtisheight=thisheightpopwindow=window.open(tisurl, "newwindow", "toolbar=no,width="+tiswidth+",height="+tisheight+",top="+tistopposition+",left="+(tisleftposition)+"");screenwidth=window.screen.widthscreenheight=window.screen.heightendposition_x=screenwidth-thiswidth-thismarginendposition_y=screenheight-thisheight-thismarginmovedown()}function movedown() {if (tistopposition<=endposition_y-50) {popwindow.moveTo(tisleftposition,tistopposition)tistopposition+=steptimer= setTimeout("movedown()",pause)}else {clearTimeout(timer)tistopposition=endposition_y-50popwindow.moveTo(tisleftposition,tistopposition)moveright()}}function moveright() {if (tisleftposition<=endposition_x) {popwindow.moveTo(tisleftposition,tistopposition)tisleftposition+=steptimer= setTimeout("moveright()",pause)}else {clearTimeout(timer)tisleftposition=endposition_xpopwindow.moveTo(tisleftposition,tistopposition)moveup()}}function moveup() {if (tistopposition>=thismargin) {popwindow.moveTo(tisleftposition,tistopposition)tistopposition-=steptimer= setTimeout("moveup()",pause)}else {clearTimeout(timer)tistopposition=thismarginpopwindow.moveTo(tisleftposition,tistopposition)moveleft()}}function moveleft() {if (tisleftposition>=thismargin) {popwindow.moveTo(tisleftposition,tistopposition)tisleftposition-=steptimer= setTimeout("moveleft()",pause)}else {clearTimeout(timer)tisleftposition=thismarginpopwindow.moveTo(tisleftposition,tistopposition)}}</SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<body onLoad="openpopup('jsbankpopup.htm','300','180')"></body><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->