|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Junior Member
Iscritto dal: Jun 2006
Messaggi: 13
|
[javascript] rotazione di file, compresi pdf
Ho questo codice in javascript, che effettua lo slideshow dei file inseriti in una stringa nominata "arrPages". Funziona se si inseriscono nell'array file immagine e file html, ma se inserisco un file PDF, quest'ultimo viene visualizzato ma la rotazione dei file si blocca e resta a schermo il file pdf in eterno. Non riesco a capire perchè, qualcuno sa come fare per far visualizzare i file in pdf senza bloccare la rotazione della slideshow?
Codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script type="text/javascript">
var i=0,
arrPages=["http://localhost/prova.jpg","http://localhost/prova.pdf","http://localhost/prova.htm"];
function changePage(){
if(!arrPages[i]) i=0;
document.getElementById("main").src=arrPages[i++];
}
</script>
</head>
<body>
<iframe src="about :blank" onload="setTimeout('changePage()',3000)"
id="main" width="100%" height="100%"></iframe>
</body>
</html>
|
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Apr 2004
Città: Livorno
Messaggi: 6659
|
Il problema è che non viene fatto partire l'evento onload dell'<iframe> quando viene caricato un PDF.
Prova a togliere quell'onload e a mettere questo sul <body>: Codice HTML:
<body onload="setInterval(changePage, 3000);">
__________________
HWU Rugby Group :'( - FAQ Processori - Aurea Sectio - CogitoWeb: idee varie sviluppando nel web
|
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 04:24.











HWU Rugby Group








