• Home
  • Forum
  • Fare Web
  • Javascript

Sostituire il comando body onload

  • Creatore Discussione Creatore Discussione cavaliere123
  • Data di inizio Data di inizio 21 Ago 2012
  • Tag Tag
    javascript visualizzatore immagini
  • 1
  • 2
Succ.
1 di 2 Succ. Ultimo
C

cavaliere123

Utente Attivo
31 Lug 2012
416
0
16
  • 21 Ago 2012
  • #1
Salve e rieccomi, ho usato questo script e abbellito e chiaramente in una pagina web funziona benissimo e ve lo posto, chiaramente è un visualizzatore di immagini :

HTML:
<HTML>
<HEAD>


<style type="text/css">
<!--  
//<![CDATA[
.Caption {
font-family: vivaldi;
font-weight: bold;
font-size:  22pt;
color:black;
 }

A.Controls:link    { color:#666666;
                     text-decoration:none;
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
A.Controls:visited { color:#666666; text-decoration:none; 
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
A.Controls:active  { color:#666666; text-decoration:none;
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
A.Controls:hover   { color:#00FF00; text-decoration:none;
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
-->
</style>
<script type="text/javascript">
<!-- 
// (C) 2003 by CodeLifter.com
// Free for all users, but leave in this header.

// ==============================
// Set the following variables...
// ==============================



// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 3;

var Picture = new Array(); // don't change this
var Caption = new Array(); // don't change this
var showHot = false;       // don't change this

// Specify the image files...
// To add more images, just continue
// the pattern, adding to the array below.
// To use fewer images, remove lines
// starting at the end of the Picture array.
// Caution: The number of Pictures *must*
// equal the number of Captions!

Picture[1]  = 'http://1.bp.blogspot.com/-CXpSTjfe6QA/UDKcxLPAmOI/AAAAAAAABjE/P4gkr01LPjw/s1600/Maschio+Angioino.jpg';
Picture[2]  = 'http://2.bp.blogspot.com/-6j6mbZ7HviA/UDKcxLzN9EI/AAAAAAAABjA/4XnWT7tfQQg/s1600/CastelDelMonte.jpg';
Picture[3]  = 'http://2.bp.blogspot.com/-7QfusEt0Rec/UDKcxF7kzHI/AAAAAAAABjI/fZ4pm8YPr74/s1600/CastelSantAngelo.jpg';


// Specify the Captions...
// To add more captions, just continue
// the pattern, adding to the array below.
// To use fewer captions, remove lines
// starting at the end of the Caption array.
// Caution: The number of Captions *must*
// equal the number of Pictures!

Caption[1]  = "Foto1: inizio";
Caption[2]  = "Castello antico del Medioevo, resistito sino ai giorni nostri per volonta' di mecenati del luogo";
Caption[3]  = "Foto3";

// =====================================
// Do not edit anything below this line!
// =====================================

var tss;
var iss;
var jss = 0;
var pss = Picture.length-1;

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}

function control(how){
if (showHot){
if (how=="H") jss = 1;
if (how=="F") jss = jss + 1;
if (how=="B") jss = jss - 1;
if (jss > (pss)) jss=1;
if (jss < 1) jss = pss;
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[jss].src;
if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
}}
//]]>
 -->
</script>

</HEAD>

<BODY>

<body onload='showHot=true;self.focus();'>

<div align="center"><table border=1 cellpadding=10 cellspacing=0 width=350px>
  <tr>

    <td width=350 height=300 colspan="3" style="background-color:red;">
    <img src=http://1.bp.blogspot.com/-at2tjuIsg-M/UDKl6L5I1NI/AAAAAAAABkU/eu6zQm0wVZE/s1600/SECONDA1.gif; name=PictureBox width=350 height=300 alt="">
    </td>
  </tr>
  <tr>

    <td id=CaptionBox class=Caption align=center colspan="3" style="background-color:#FF6600";">
  Premi i pulsanti &lt; &gt;
    </td>
  </tr>

  <tr>
    <td align="center" style="background-color:#33CCCC">
    <a class=Controls href="#" onClick="javascript:control('B');" title="indietro">&lt; &lt;</a>
    </td>
    <td align="center" style="background-color:#FFFF66">
    <a class=Controls href="#" onClick="javascript:control('H');" title="inizio">| | |</a>
    </td>
    <td align="center" style="background-color:#33CCCC">
    <a class=Controls href="#" onClick="javascript:control('F');" title="avanti">&gt; &gt;</a>
    </td>
  </tr>  
</table></div>

</BODY>
</HTML>

Adesso volevo inserirlo nel mio blog in un gadget html/javascript .
Quando si inserisce tutto il codice chiaramente i comandi body non li esegue e quindi mi ritrovo la seguente stringa :

HTML:
<body onload='showHot=true;self.focus();'>
da dover sostituire con un comando javascript che verrà interpretato, potete aiutarmi ?? Grazie.
 
M

Malware

Utente Attivo
19 Lug 2012
112
0
0
  • 21 Ago 2012
  • #2
Tempo fa ho avuto il tuo stesso problema.

Prova ad inserire nello script window.onload(comandi...);

Non ricordo se è window oppire document
Dovrebbe funzionare uno dei due
 
C

cavaliere123

Utente Attivo
31 Lug 2012
416
0
16
  • 21 Ago 2012
  • #3
Salve e grazie per avermi risposto, ho provato cosi :

HTML:
if(  showHot==true) {  
 window.onload=control(how)}
ma non va...
non sono cosi esperto.... ti spiace dare una occhiata, altrimenti grazie lo stesso )
 
M

Malware

Utente Attivo
19 Lug 2012
112
0
0
  • 21 Ago 2012
  • #4
ciao
ecco la sintassi corretta:


Codice:
document.onload=setInterval("countdown_ampliamento();","1000");

Qua io ad esempio dovevo far partire un countdown
 
C

cavaliere123

Utente Attivo
31 Lug 2012
416
0
16
  • 21 Ago 2012
  • #5
Grazie per prima cosa e ho sostituito cosi :

document.onload='showHot=true;self.focus();'

ma chiaramente non va... figuriamoci
 
C

cavaliere123

Utente Attivo
31 Lug 2012
416
0
16
  • 21 Ago 2012
  • #6
provato anche cosi :

HTML:
document.onload=control(how);
self.focus();


e anche :

HTML:
if (showHot==true) {
document.onload=control(how);
self.focus();   }

e neanche ....
 

Vale2

Utente Attivo
28 Mag 2006
446
0
0
Livorno
  • 21 Ago 2012
  • #7
Ciao,

qui:

Codice:
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
}}
//]]>
document.onload=showHot=true;self.focus();
-->

togli //<![CDATA[ dal CSS non sono acettati commenti con //


mettilo nel js

Codice:
// ==============================
// Set the following variables...
// ==============================

//<![CDATA[

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 3;


Valeria.
 
C

cavaliere123

Utente Attivo
31 Lug 2012
416
0
16
  • 21 Ago 2012
  • #8
Grazie Valeria del suggerimento che ho subito eseguito :

HTML:
// ==============================
// Set the following variables...
// ==============================

//<![CDATA[

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 3;

spero di aver compreso bene, perdonami hai letto la mia richiesta, nonostante l'aiuto cortese di Malware, non ci sono riuscito... se puoi... cmq grazie ancora
 

Vale2

Utente Attivo
28 Mag 2006
446
0
0
Livorno
  • 21 Ago 2012
  • #9
Codice:
<HTML>
<HEAD>


<style type="text/css">
<!--  

.Caption {
font-family: vivaldi;
font-weight: bold;
font-size:  22pt;
color:black;
 }

A.Controls:link    { color:#666666;
                     text-decoration:none;
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
A.Controls:visited { color:#666666; text-decoration:none; 
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
A.Controls:active  { color:#666666; text-decoration:none;
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
A.Controls:hover   { color:#00FF00; text-decoration:none;
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
-->
</style>
<script type="text/javascript">
<!-- 
// (C) 2003 by CodeLifter.com
// Free for all users, but leave in this header.

// ==============================
// Set the following variables...
// ==============================

//<![CDATA[

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 3;

var Picture = new Array(); // don't change this
var Caption = new Array(); // don't change this
var showHot = false;       // don't change this

// Specify the image files...
// To add more images, just continue
// the pattern, adding to the array below.
// To use fewer images, remove lines
// starting at the end of the Picture array.
// Caution: The number of Pictures *must*
// equal the number of Captions!

Picture[1]  = 'http://1.bp.blogspot.com/-CXpSTjfe6QA/UDKcxLPAmOI/AAAAAAAABjE/P4gkr01LPjw/s1600/Maschio+Angioino.jpg';
Picture[2]  = 'http://2.bp.blogspot.com/-6j6mbZ7HviA/UDKcxLzN9EI/AAAAAAAABjA/4XnWT7tfQQg/s1600/CastelDelMonte.jpg';
Picture[3]  = 'http://2.bp.blogspot.com/-7QfusEt0Rec/UDKcxF7kzHI/AAAAAAAABjI/fZ4pm8YPr74/s1600/CastelSantAngelo.jpg';


// Specify the Captions...
// To add more captions, just continue
// the pattern, adding to the array below.
// To use fewer captions, remove lines
// starting at the end of the Caption array.
// Caution: The number of Captions *must*
// equal the number of Pictures!

Caption[1]  = "Foto1: inizio";
Caption[2]  = "Castello antico del Medioevo, resistito sino ai giorni nostri per volonta' di mecenati del luogo";
Caption[3]  = "Foto3";

// =====================================
// Do not edit anything below this line!
// =====================================

var tss;
var iss;
var jss = 0;
var pss = Picture.length-1;

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}

function control(how){
if (showHot){
if (how=="H") jss = 1;
if (how=="F") jss = jss + 1;
if (how=="B") jss = jss - 1;
if (jss > (pss)) jss=1;
if (jss < 1) jss = pss;
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[jss].src;
if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
}}
//]]>
document.onload=showHot=true;self.focus();
-->
</script>

</HEAD>

<BODY>


<div align="center"><table border=1 cellpadding=10 cellspacing=0 width=350px>
  <tr>

    <td width=350 height=300 colspan="3" style="background-color:red;">
    <img src=http://1.bp.blogspot.com/-at2tjuIsg-M/UDKl6L5I1NI/AAAAAAAABkU/eu6zQm0wVZE/s1600/SECONDA1.gif; name=PictureBox width=350 height=300 alt="">
    </td>
  </tr>
  <tr>

    <td id=CaptionBox class=Caption align=center colspan="3" style="background-color:#FF6600";">
  Premi i pulsanti &lt; &gt;
    </td>
  </tr>

  <tr>
    <td align="center" style="background-color:#33CCCC">
    <a class=Controls href="#" onClick="javascript:control('B');" title="indietro">&lt; &lt;</a>
    </td>
    <td align="center" style="background-color:#FFFF66">
    <a class=Controls href="#" onClick="javascript:control('H');" title="inizio">| | |</a>
    </td>
    <td align="center" style="background-color:#33CCCC">
    <a class=Controls href="#" onClick="javascript:control('F');" title="avanti">&gt; &gt;</a>
    </td>
  </tr>  
</table></div>

</BODY>
</HTML>

il filter blendTrans funziona solo con MSIE

Valeria
 
C

cavaliere123

Utente Attivo
31 Lug 2012
416
0
16
  • 21 Ago 2012
  • #10
Io uso Crome e nella pagina html funziona perfettamente, non saprei poi sinceramente come sostituire...
aspita hai corretto la riga....
Grazieeeeeeeeee, da gentiluomo ti offrirei una cena parola
mi permetto di scherzare proprio perchè contento....
Diamine ma un corso ben fatto... con tutti gli esempi man mano dove lo trovo ??
 
C

cavaliere123

Utente Attivo
31 Lug 2012
416
0
16
  • 21 Ago 2012
  • #11
Festeggiato troppo in fretta, se incollo come sempre fatto nel gadget html del mio blog cmq non se klikko sulle freccette per far scorrere le immagini non va... mi riporta sull'head del blog , questo è quello che compare nel gadget...

HTML:
<style type="text/css">
<!--  

.Caption {
font-family: vivaldi;
font-weight: bold;
font-size:  22pt;
color:black;
 }

A.Controls:link    { color:#666666;
                     text-decoration:none;
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
A.Controls:visited { color:#666666; text-decoration:none; 
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
A.Controls:active  { color:#666666; text-decoration:none;
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
A.Controls:hover   { color:#00FF00; text-decoration:none;
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
-->
</style>
<script type="text/javascript">
<!-- 
// (C) 2003 by CodeLifter.com
// Free for all users, but leave in this header.

// ==============================
// Set the following variables...
// ==============================

//<![CDATA[

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 3;

var Picture = new Array(); // don't change this
var Caption = new Array(); // don't change this
var showHot = false;       // don't change this

// Specify the image files...
// To add more images, just continue
// the pattern, adding to the array below.
// To use fewer images, remove lines
// starting at the end of the Picture array.
// Caution: The number of Pictures *must*
// equal the number of Captions!

Picture[1]  = 'http://1.bp.blogspot.com/-CXpSTjfe6QA/UDKcxLPAmOI/AAAAAAAABjE/P4gkr01LPjw/s1600/Maschio+Angioino.jpg';
Picture[2]  = 'http://2.bp.blogspot.com/-6j6mbZ7HviA/UDKcxLzN9EI/AAAAAAAABjA/4XnWT7tfQQg/s1600/CastelDelMonte.jpg';
Picture[3]  = 'http://2.bp.blogspot.com/-7QfusEt0Rec/UDKcxF7kzHI/AAAAAAAABjI/fZ4pm8YPr74/s1600/CastelSantAngelo.jpg';


// Specify the Captions...
// To add more captions, just continue
// the pattern, adding to the array below.
// To use fewer captions, remove lines
// starting at the end of the Caption array.
// Caution: The number of Captions *must*
// equal the number of Pictures!

Caption[1]  = "Foto1: inizio";
Caption[2]  = "Castello antico del Medioevo, resistito sino ai giorni nostri per volonta' di mecenati del luogo";
Caption[3]  = "Foto3";

// =====================================
// Do not edit anything below this line!
// =====================================

var tss;
var iss;
var jss = 0;
var pss = Picture.length-1;

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}

function control(how){
if (showHot){
if (how=="H") jss = 1;
if (how=="F") jss = jss + 1;
if (how=="B") jss = jss - 1;
if (jss > (pss)) jss=1;
if (jss < 1) jss = pss;
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[jss].src;
if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
}}
//]]>
 -->
document.onload=showHot=true;self.focus();
</script>
















<div align="center"><table border=1 cellpadding=10 cellspacing=0 width=350px>
  <tr>

    <td width=350 height=300 colspan="3" style="background-color:red;">
    <img src="http://1.bp.blogspot.com/-at2tjuIsg-M/UDKl6L5I1NI/AAAAAAAABkU/eu6zQm0wVZE/s1600/SECONDA1.gif;" name="PictureBox" width="350" height="300" alt="" />
    </td>
  </tr>
  <tr>

    <td id=captionbox class=caption align=center colspan="3" style="background-color:#FF6600";">
  Premi i pulsanti &lt; &gt;
    </td>
  </tr>

  <tr>
    <td align="center" style="background-color:#33CCCC">
    <a class=controls href="#" onclick="javascript:control('b');" title="indietro">&lt; &lt;</a>
    </td>
    <td align="center" style="background-color:#FFFF66">
    <a class=controls href="#" onclick="javascript:control('h');" title="inizio">| | |</a>
    </td>
    <td align="center" style="background-color:#33CCCC">
    <a class=controls href="#" onclick="javascript:control('f');" title="avanti">&gt; &gt;</a>
    </td>
  </tr>  
</table></div>
 

Vale2

Utente Attivo
28 Mag 2006
446
0
0
Livorno
  • 21 Ago 2012
  • #12
Ciao,

prova aggiungendo una istruzione return con valore falso nei link, il # è un link a tutti gli effetti se non c'è un return false ti porta a inizio pagina.


Codice:
<td align="center" style="background-color:#33CCCC">
    <a class=Controls href="#" onClick="javascript:control('B'); return false" title="indietro">&lt; &lt;</a>
    </td>
    <td align="center" style="background-color:#FFFF66">
    <a class=Controls href="#" onClick="javascript:control('H'); return false" title="inizio">| | |</a>
    </td>
    <td align="center" style="background-color:#33CCCC">
    <a class=Controls href="#" onClick="javascript:control('F'); return false" title="avanti">&gt; &gt;</a>


Valeria.
 
C

cavaliere123

Utente Attivo
31 Lug 2012
416
0
16
  • 21 Ago 2012
  • #13
mo provo grazie

e su IE manco funziona.... grrrrrrrrr..... ma perchè non funziona auff...
 
C

cavaliere123

Utente Attivo
31 Lug 2012
416
0
16
  • 21 Ago 2012
  • #14
E chiaramente neanche nel blog.... e meno male che doveva essere uno script semplice grrrrrrrrrrrr....
 

Vale2

Utente Attivo
28 Mag 2006
446
0
0
Livorno
  • 21 Ago 2012
  • #15
Ciao,

rispetta come sono scritte le dichiarazione dei vari metodi maiuscole e minuscole.

Codice:
<div align="center"><table border=1 cellpadding=10 cellspacing=0 width=350px>
  <tr>

    <td width=350 height=300 colspan="3" style="background-color:red;">
    <img src="http://1.bp.blogspot.com/-at2tjuIsg-M/UDKl6L5I1NI/AAAAAAAABkU/eu6zQm0wVZE/s1600/SECONDA1.gif;" name="PictureBox" width="350" height="300" alt="" />
    </td>
  </tr>
  <tr>

    <td id=[B]CaptionBox[/B] class=[B]Caption[/B] align=center colspan="3" style="background-color:#FF6600";">
  Premi i pulsanti &lt; &gt;
    </td>
  </tr>

  <tr>
    <td align="center" style="background-color:#33CCCC">
    <a class=[B]Controls[/B] href="#" onclick="javascript:control('B'); [B]return false[/B]" title="indietro">&lt; &lt;</a>
    </td>
    <td align="center" style="background-color:#FFFF66">
    <a class=[B]Controls[/B] href="#" onclick="javascript:control('H');" title="inizio">| | |</a>
    </td>
    <td align="center" style="background-color:#33CCCC">
    <a class=[B]Controls[/B] href="#" onclick="javascript:control('F');" title="avanti">&gt; &gt;</a>
    </td>
  </tr>  
</table></div>


Valeria.
 
C

cavaliere123

Utente Attivo
31 Lug 2012
416
0
16
  • 21 Ago 2012
  • #16
Gentilissima Valeria chiaramente non finisco di ringraziarti.... ma anche incollando la tua parte di codice nel blog non va... compaiono le immagini ma appena klikko sulle freccette mi riporta sul top del blog....

ti posto tutto il codice , ormai sono desolato.... auff...

HTML:
<HTML>
<HEAD>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="imagetoolbar" content="no" />


<style type="text/css">
<!--  

.Caption {
font-family: vivaldi;
font-weight: bold;
font-size:  22pt;
color:black;
 }

A.Controls:link    { color:#666666;
                     text-decoration:none;
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
A.Controls:visited { color:#666666; text-decoration:none; 
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
A.Controls:active  { color:#666666; text-decoration:none;
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
A.Controls:hover   { color:#00FF00; text-decoration:none;
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
-->
</style>
<script type="text/javascript">
<!-- 
// (C) 2003 by CodeLifter.com
// Free for all users, but leave in this header.

// ==============================
// Set the following variables...
// ==============================

//<![CDATA[

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 3;

var Picture = new Array(); // don't change this
var Caption = new Array(); // don't change this
var showHot = false;       // don't change this

// Specify the image files...
// To add more images, just continue
// the pattern, adding to the array below.
// To use fewer images, remove lines
// starting at the end of the Picture array.
// Caution: The number of Pictures *must*
// equal the number of Captions!

Picture[1]  = 'http://1.bp.blogspot.com/-CXpSTjfe6QA/UDKcxLPAmOI/AAAAAAAABjE/P4gkr01LPjw/s1600/Maschio+Angioino.jpg';
Picture[2]  = 'http://2.bp.blogspot.com/-6j6mbZ7HviA/UDKcxLzN9EI/AAAAAAAABjA/4XnWT7tfQQg/s1600/CastelDelMonte.jpg';
Picture[3]  = 'http://2.bp.blogspot.com/-7QfusEt0Rec/UDKcxF7kzHI/AAAAAAAABjI/fZ4pm8YPr74/s1600/CastelSantAngelo.jpg';


// Specify the Captions...
// To add more captions, just continue
// the pattern, adding to the array below.
// To use fewer captions, remove lines
// starting at the end of the Caption array.
// Caution: The number of Captions *must*
// equal the number of Pictures!

Caption[1]  = "Foto1: inizio";
Caption[2]  = "Castello antico del Medioevo, resistito sino ai giorni nostri per volonta' di mecenati del luogo";
Caption[3]  = "Foto3";

// =====================================
// Do not edit anything below this line!
// =====================================

var tss;
var iss;
var jss = 0;
var pss = Picture.length-1;

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}

function control(how){
if (showHot){
if (how=="H") jss = 1;
if (how=="F") jss = jss + 1;
if (how=="B") jss = jss - 1;
if (jss > (pss)) jss=1;
if (jss < 1) jss = pss;
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[jss].src;
if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
}}
//]]>
 -->


document.onload=showHot=true;self.focus();
</script>

</HEAD>


<BODY>


<div align="center"><table border=1 cellpadding=10 cellspacing=0 width=350px>
  <tr>

    <td width=350 height=300 colspan="3" style="background-color:red;">
    <img src="http://1.bp.blogspot.com/-at2tjuIsg-M/UDKl6L5I1NI/AAAAAAAABkU/eu6zQm0wVZE/s1600/SECONDA1.gif;" name="PictureBox" width="350" height="300" alt="" />
    </td>
  </tr>
  <tr>

    <td id=CaptionBox class=Caption align=center colspan="3" style="background-color:#FF6600";">
  Premi i pulsanti &lt; &gt;
    </td>
  </tr>

  <tr>
    <td align="center" style="background-color:#33CCCC">
    <a class=Controls href="#" onclick="javascript:control('B'); return false" title="indietro">&lt; &lt;</a>
    </td>
    <td align="center" style="background-color:#FFFF66">
    <a class=Controls href="#" onclick="javascript:control('H');" title="inizio">| | |</a>
    </td>
    <td align="center" style="background-color:#33CCCC">
    <a class=Controls href="#" onclick="javascript:control('F');" title="avanti">&gt; &gt;</a>
    </td>
  </tr>  
</table></div>

</BODY>
</HTML>

se vuoi ti linko anche il mio blog cosi vedrai cosa succede ma avvertimi se vuoi.... non desidero disturbarti .... Ciao Domenico.
 

Vale2

Utente Attivo
28 Mag 2006
446
0
0
Livorno
  • 21 Ago 2012
  • #17
Ciao,

basta un poco di attenzione:

Corretto:

Codice:
//]]>
[B]document.onload=showHot=true;self.focus();
-->[/B]


Errato come è postato


Codice:
 //]]>
 -->
document.onload=showHot=true;self.focus();;

se usi i commenti nei js <!-- --> subito dopo script e prima di /script
 
C

cavaliere123

Utente Attivo
31 Lug 2012
416
0
16
  • 21 Ago 2012
  • #18
ok corretto

HTML:
function control(how){
if (showHot){
if (how=="H") jss = 1;
if (how=="F") jss = jss + 1;
if (how=="B") jss = jss - 1;
if (jss > (pss)) jss=1;
if (jss < 1) jss = pss;
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[jss].src;
if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
}}
//]]>




document.onload=showHot=true;self.focus();

 -->
      </script>

</HEAD>

ma indovina, nel blog fa sempre la stessa cosa
chiaramente ho sostituito con le correzioni....

---> ma perchè ho voluto fare un blog ? <--------
 

Vale2

Utente Attivo
28 Mag 2006
446
0
0
Livorno
  • 21 Ago 2012
  • #19
cavaliere123 ha scritto:
Gentilissima Valeria chiaramente non finisco di ringraziarti.... ma anche incollando la tua parte di codice nel blog non va... compaiono le immagini ma appena klikko sulle freccette mi riporta sul top del blog....

ti posto tutto il codice , ormai sono desolato.... auff...

HTML:
<HTML>
<HEAD>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="imagetoolbar" content="no" />


<style type="text/css">
<!--  

.Caption {
font-family: vivaldi;
font-weight: bold;
font-size:  22pt;
color:black;
 }

A.Controls:link    { color:#666666;
                     text-decoration:none;
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
A.Controls:visited { color:#666666; text-decoration:none; 
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
A.Controls:active  { color:#666666; text-decoration:none;
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
A.Controls:hover   { color:#00FF00; text-decoration:none;
                     font-family: Arial;
                     font-size:   14pt;
                     font-weight: bold; }
-->
</style>
<script type="text/javascript">
<!-- 
// (C) 2003 by CodeLifter.com
// Free for all users, but leave in this header.

// ==============================
// Set the following variables...
// ==============================

//<![CDATA[

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 3;

var Picture = new Array(); // don't change this
var Caption = new Array(); // don't change this
var showHot = false;       // don't change this

// Specify the image files...
// To add more images, just continue
// the pattern, adding to the array below.
// To use fewer images, remove lines
// starting at the end of the Picture array.
// Caution: The number of Pictures *must*
// equal the number of Captions!

Picture[1]  = 'http://1.bp.blogspot.com/-CXpSTjfe6QA/UDKcxLPAmOI/AAAAAAAABjE/P4gkr01LPjw/s1600/Maschio+Angioino.jpg';
Picture[2]  = 'http://2.bp.blogspot.com/-6j6mbZ7HviA/UDKcxLzN9EI/AAAAAAAABjA/4XnWT7tfQQg/s1600/CastelDelMonte.jpg';
Picture[3]  = 'http://2.bp.blogspot.com/-7QfusEt0Rec/UDKcxF7kzHI/AAAAAAAABjI/fZ4pm8YPr74/s1600/CastelSantAngelo.jpg';


// Specify the Captions...
// To add more captions, just continue
// the pattern, adding to the array below.
// To use fewer captions, remove lines
// starting at the end of the Caption array.
// Caution: The number of Captions *must*
// equal the number of Pictures!

Caption[1]  = "Foto1: inizio";
Caption[2]  = "Castello antico del Medioevo, resistito sino ai giorni nostri per volonta' di mecenati del luogo";
Caption[3]  = "Foto3";

// =====================================
// Do not edit anything below this line!
// =====================================

var tss;
var iss;
var jss = 0;
var pss = Picture.length-1;

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}

function control(how){
if (showHot){
if (how=="H") jss = 1;
if (how=="F") jss = jss + 1;
if (how=="B") jss = jss - 1;
if (jss > (pss)) jss=1;
if (jss < 1) jss = pss;
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[jss].src;
if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
}}
//]]>
 -->


document.onload=showHot=true;self.focus();
</script>

</HEAD>


<BODY>


<div align="center"><table border=1 cellpadding=10 cellspacing=0 width=350px>
  <tr>

    <td width=350 height=300 colspan="3" style="background-color:red;">
    <img src="http://1.bp.blogspot.com/-at2tjuIsg-M/UDKl6L5I1NI/AAAAAAAABkU/eu6zQm0wVZE/s1600/SECONDA1.gif;" name="PictureBox" width="350" height="300" alt="" />
    </td>
  </tr>
  <tr>

    <td id=CaptionBox class=Caption align=center colspan="3" style="background-color:#FF6600";">
  Premi i pulsanti &lt; &gt;
    </td>
  </tr>

  <tr>
    <td align="center" style="background-color:#33CCCC">
    <a class=Controls href="#" onclick="javascript:control('B'); return false" title="indietro">&lt; &lt;</a>
    </td>
    <td align="center" style="background-color:#FFFF66">
    <a class=Controls href="#" onclick="javascript:control('H');" title="inizio">| | |</a>
    </td>
    <td align="center" style="background-color:#33CCCC">
    <a class=Controls href="#" onclick="javascript:control('F');" title="avanti">&gt; &gt;</a>
    </td>
  </tr>  
</table></div>

</BODY>
</HTML>

se vuoi ti linko anche il mio blog cosi vedrai cosa succede ma avvertimi se vuoi.... non desidero disturbarti .... Ciao Domenico.
Clicca per allargare...

Ciao,

dimenticavo, come già detto qualche post sopra il # senza un return false ti porta la pagina a top, puoi scrivere i link in questo modo per evitarlo.

Codice:
<a class=Controls href="javascript:void(0)" onclick="javascript:control('B');" title="indietro">&lt; &lt;</a>

<a class=Controls href="#" onclick="javascript:control('F'); return false" title="avanti">&gt; &gt;</a>

il return false istruisce il browser a dichiarare falso l'href e di eseguire solo onclick javascript:void(0) nell'href fa la stessa cosa.

sistema come sopra:

//]]>
document.onload=showHot=true;self.focus();
-->


deve essere scritto cosi.

Valeria.
 
C

cavaliere123

Utente Attivo
31 Lug 2012
416
0
16
  • 21 Ago 2012
  • #20
allora ho messo cosi :

HTML:
 <tr>
    <td align="center" style="background-color:#33CCCC">
    <a class=controls href="javascript:void(0)" onclick="javascript:control('b');" title="indietro">&lt; &lt;</a>
    </td>
    <td align="center" style="background-color:#FFFF66">
    <a class=controls href="javascript:void(0)" onclick="javascript:control('h'); " title="inizio">| | |</a>
    </td>
    <td align="center" style="background-color:#33CCCC">
    <a class=controls href="javascript:void(0)" onclick="javascript:control('f'); " title="avanti">&gt; &gt;</a>
    </td>
  </tr>  
</table></div>

adesso mi fa andare avanti di una foto ma poi non mi fa proseguire ne tornare indietro ne all'inizio... ti prego solo un attimo di pazienza... mi posti tutto il td se non ti dispiace, tanto tu il problema l'hai individuato... scusa.... )
e scusami per l'errore del onboard , avevo corretto solo che non salvato e quindi ritornato come prima----
 
  • 1
  • 2
Succ.
1 di 2 Succ. Ultimo
Devi accedere o registrarti per poter rispondere.

Discussioni simili

Sostituire un div con un altro il comando innerHTML è bloccato
  • max_400
  • 17 Ago 2014
  • Javascript
Risposte
0
Visite
2K
Javascript 17 Ago 2014
max_400
D
Sostituire img con altre img
  • Devja
  • 9 Set 2020
  • Photoshop
Risposte
1
Visite
1K
Photoshop 9 Set 2020
Max 1
P
[MS Access] Sostituire un carattere in tutta la tabella
  • Palicare
  • 6 Dic 2019
  • MS Access
Risposte
11
Visite
6K
MS Access 1 Giu 2021
picentia
P
[MySQL] Sostituire testo in in articolo
  • Shyson
  • 24 Mag 2019
  • MySQL
Risposte
0
Visite
1K
MySQL 24 Mag 2019
Shyson
[MySQL] Sostituire valori campi con dati casuali
  • elpirata
  • 4 Ott 2018
  • MySQL
Risposte
4
Visite
2K
MySQL 5 Ott 2018
borgo italia
P
[Photoshop] Sostituire i colori in modo preciso
  • potoshoppista
  • 1 Ott 2018
  • Photoshop
Risposte
0
Visite
1K
Photoshop 1 Ott 2018
potoshoppista
P
C
[PHP] SOSTITUIRE VALORI DENTRO STRINGA
  • colomber
  • 30 Ago 2017
  • PHP
Risposte
0
Visite
1K
PHP 30 Ago 2017
colomber
C
[PHP] Sostituire if ed elseif con operatore ternario switch
  • elpirata
  • 22 Mag 2017
  • PHP
Risposte
9
Visite
2K
PHP 24 Mag 2017
elpirata
L
[PHP] Sostituire link da stringa
  • lorenzo84
  • 31 Mar 2017
  • PHP
Risposte
3
Visite
2K
PHP 1 Apr 2017
criric
[WORDPRESS] Sostituire la cartella d'installazione?
  • ecosito
  • 21 Gen 2017
  • WordPress
Risposte
2
Visite
2K
WordPress 22 Gen 2017
LinuxOhYeah
L
S
[Javascript] Sostituire elemento HTML preso randomicamente dentro array
  • sunlightbanana
  • 5 Nov 2016
  • Javascript
Risposte
1
Visite
2K
Javascript 5 Nov 2016
sunlightbanana
S
M
Sostituire le funzioni mysql con mysqli, ma quali?
  • mickey123
  • 20 Mag 2016
  • PHP
Risposte
4
Visite
2K
PHP 21 Mag 2016
borgo italia
S
Sostituire link con button.
  • Strelecaster
  • 6 Mag 2016
  • PHP
Risposte
1
Visite
1K
PHP 6 Mag 2016
Strelecaster
S
M
sostituire parte di URL con espressioni regolari PHP
  • mickey123
  • 10 Apr 2015
  • PHP
Risposte
8
Visite
3K
PHP 10 Apr 2015
mickey123
M
Come sostituire valori in un campo per più oggetti.
  • Marco_88
  • 6 Feb 2015
  • MySQL
Risposte
2
Visite
2K
MySQL 9 Feb 2015
Marco_88
Sostituire una riga specifica in un file di testo senza cancellare il rimanente
  • JackIlPazzo
  • 18 Nov 2014
  • PHP
Risposte
13
Visite
6K
PHP 19 Dic 2014
Longo8
A
sostituire "onload" nel tag <img> con Js
  • acweb-2004
  • 23 Ago 2014
  • Javascript
Risposte
17
Visite
5K
Javascript 25 Ago 2014
acweb-2004
A
C
Sostituire virgola con punto form
  • colomber
  • 27 Lug 2014
  • PHP
Risposte
2
Visite
8K
PHP 27 Lug 2014
colomber
C
P
sostituire form con jquery
  • processore
  • 16 Lug 2014
  • jQuery
Risposte
0
Visite
2K
jQuery 16 Lug 2014
processore
P
F
sostituire un'immagine con jquery
  • Fabio90
  • 18 Mag 2014
  • jQuery
Risposte
2
Visite
4K
jQuery 19 Mag 2014
Fabio90
F
Condividi:
Facebook X (Twitter) LinkedIn WhatsApp e-mail Condividi Link
  • Home
  • Forum
  • Fare Web
  • Javascript
  • Italiano
  • Termini e condizioni d'uso del sito
  • Policy Privacy
  • Aiuto
  • Home
Community platform by XenForo® © 2010-2024 XenForo Ltd. | Traduzione a cura di XenForo Italia
Menu
Accedi

Registrati

  • Home
  • Forum
    • Nuovi Messaggi
    • Cerca...
  • Novità
    • Featured content
    • Nuovi Messaggi
    • Ultime Attività
X

Privacy & Transparency

We use cookies and similar technologies for the following purposes:

  • Personalized ads and content
  • Content measurement and audience insights

Do you accept cookies and these technologies?

X

Privacy & Transparency

We use cookies and similar technologies for the following purposes:

  • Personalized ads and content
  • Content measurement and audience insights

Do you accept cookies and these technologies?