Aprire una finestra in movimento
Aperturadi una finestra in movimento
Lo script che vi propongo permettedi realizzare una finestra, con dimensioni scelte da voi, chesi apre insieme alla pagina scelta e si muove da sinistraverso destra.
Il codice da inserire nella paginascelta è poco...la finestra che si aprirà ladovrete creare voi, con all'interno il messaggio e/o leimmagini che desiderate. Inoltre dovrete creare con il Blocconote di Windows un file .js.
Esempio
Questa è la paginaprincipale.
<HTML><HEAD><TITLE>Benvenuti su WebMasterPoint</TITLE></head><body onLoad="openpopup('finestrainmov.htm','300','300','200')"><SCRIPT SRC="inmoto.js"></SCRIPT><p align="center"><b><font face="Arial" size="4">WebMaster Point: il punto diriferimento dei webmaster</font></b></p></BODY></HTML>
Questa è la finestra inmovimento, che ho chiamato finestrainmov.htm.
<html><head><title>Ciao ragazzi!</title></head><body></body></html>
Questo è il codice dainserire nel file .js, che io ho chiamato inmoto.js.
var popwindowvar tisurlvar tiswidthvar tisheightvar tistoppositionvar tisleftpositionvar pause=10var step=5var marginrightvar endpositionvar timer function openpopup(thisurl,thiswidth,thisheight,thistopposition) { tisurl=thisurl tiswidth=thiswidth tisheight=thisheight tistopposition=thistopposition tisleftposition=-tiswidth popwindow=window.open(tisurl, "newwindow" , "toolbar=no,width=" +tiswidth+ " ,height=" +tisheight+ " ,top=" +tistopposition+ " ,left=" +(tisleftposition)+ ""); if (document.all) { marginright=screen.width endposition=marginright-thiswidth-10 movewindow() } if (document.layers) { marginright=window.innerWidth-10 endposition=marginright-thiswidth movewindow() }} function movewindow() { if (tisleftposition<=endposition) { popwindow.moveTo(tisleftposition,tistopposition) tisleftposition+=step timer= setTimeout("movewindow()" ,pause) } else { clearTimeout(timer) }}
- Articolo precedente Aprire una nuova finestra centrata
- Articolo successivo Data corrente nelle pagine web
