allora....
mettete nella stessa cartella della pagina le immagini che volete vengano visualizzate.....
cambiate le due righe:
immagini = new Array("1.jpg","2.jpg","3.jpg");
link_img = new Array("http://www.italiansolutionsport.com","http://www.italpalestre.it","http://www.html.it");
mettendo i nomi delle immagini e i link che devono essere associati ad esse...
la riga
speed=5;
definisce i secondi che devono passare tra la visualizzazione di una immagine e la seguente...
un grazie particolare a xinod per alcune idee suggerite, in particolare la funzione che serve a determinare le dimensioni della finestra (la mia tell())
x qualunque cosa, chiedete......
eccovi lo script..
codice:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Web-Showner by Mario Mandina - WebMasterOne</title>
<script language="javascript">
/*
***************************************************************************
* *
* fate quello che volete, smontate *
* o cambiate a piacimento. *
* se potete, lasciate queste righe con i credits del lavoro. *
* *
* script realizzato da Mario mandina *
* Webmasterone *
* http://www.webmasterone.it *
* *
***************************************************************************
*/
// INSERITE QUI I NOMI DELLE IMMAGINI , I LINK DA ASSOCIARE ALLE STESSE
// E IL TEMPO IN SECONDI DI PERMANENZA PER OGNI IMMAGINE
immagini = new Array("1.jpg","2.jpg","3.jpg");
link_img = new Array("http://www.italiansolutionsport.com","http://www.italpalestre.it","http://www.html.it");
// velocità (in secondi)
speed=5;
function disattiva_notifica_errori(){return true;}
window.onerror=disattiva_notifica_errori;
for (x=1;x<=immagini.length;x++)
{eval("var image" + x + " = new Image();");
eval("image" + x + ".src = '" + immagini[x-1] + "';");}
document.images.slide.src = image1.src;
document.images.slide.width = image1.width;
document.images.slide.height = image1.height;
function tell()
{
w_body=window.document.body.offsetWidth;
h_body=window.document.body.offsetHeight;
window.resizeTo(400,300);
w_delta=400-window.document.body.offsetWidth;
h_delta=300-window.document.body.offsetHeight;
window.resizeTo(w_body+w_delta,h_body+h_delta);
altezza=h_body+h_delta;
larghezza=w_body+w_delta;
return larghezza+"-"+altezza+"-"+w_body+"-"+h_body
}
</script>
</head>
<body onLoad="slideit()" topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 style="overflow:hidden">
<a href="javascript:apre_link()" onMouseover="window.status='';return true" onMouseout="window.status=''">
[img]blank.gif[/img]</a>
<script>
<!--
window.resizeTo(200,200);
dimensione = tell().split("-");
scost_orizz = (dimensione[0]-dimensione[2])+4;
scost_vert = (dimensione[1]-dimensione[3])+4;
durata_terremoto = 5
start=0;
incremento = 2;
step=1;
whichimage=1;
number_of_images=immagini.length;
window.resizeTo((image1.width+scost_orizz),(image1.height+scost_vert));
window.moveTo(Math.floor((screen.width-(image1.width+scost_orizz))/2),Math.floor((screen.height-(image1.height+scost_vert))/2));
function slideit(){
if (step==1){step2=number_of_images;}else{step2 = step-1;}
a = eval("image"+step+".width")+scost_orizz;
b = eval("image"+step+".height")+scost_vert;
c = eval("image"+step2+".width")+scost_orizz;
d = eval("image"+step2+".height")+scost_vert;
ridimensiona(a,b,c,d);
slide.filters.blendTrans.apply();
document.images.slide.src = eval("image"+step+".src");
document.images.slide.width = eval("image"+step+".width");
document.images.slide.height = eval("image"+step+".height");
slide.filters.blendTrans.play()
whichimage=step
if (step<number_of_images){step++;}else{step=1;}
setTimeout("slideit()",speed*1000)
}
function resize()
{
contax = contax + x;contay = contay + y;
if (Math.abs(contax) >= Math.abs(x_delta-incremento)){x=0;vaix="no";}{vaix="ok";}
if (Math.abs(contay) >= Math.abs(y_delta-incremento)){y=0;vaiy="no";}{vaiy="ok";}
window.resizeBy(x,y)
window.moveBy(-1 * Math.floor(x/2),-1 * Math.floor(y/2))
if (x == 0 && y == 0){stop="si";ricentra();}else{resize();stop="no";}
}
function ricentra()
{
window.resizeTo(a,b);
window.moveTo(Math.floor((screen.width-a)/2),Math.floor((screen.height-b)/2));
terremoto(durata_terremoto)
}
function ridimensiona(a,b,c,d)
{
if (start==0){c=a;d=b;start++;}
x_from = c;x_to = a;y_from = d;y_to = b;
x_delta = x_to - x_from;y_delta = y_to - y_from;
if(x_delta <= 0){x = -1 * incremento;}else{x = incremento;}
if(y_delta <= 0){y = -1 * incremento;}else{y = incremento;}
contax=0;contay=0;resize();
}
function terremoto(x) {
brie4 = (navigator.appName == "Microsoft Internet Explorer") &&
(parseInt(navigator.appVersion) >= 4);
if (brie4) {for (i = 12; i > 0; i--){for (j = x; j > 0; j--)
{self.moveBy(0,i);self.moveBy(i,0);self.moveBy(0,-i);self.moveBy(-i,0);}
}}}
function apre_link()
{window.open(link_img[whichimage-1]);}
</script>
</body>
</html>