Ciao a tutti,
ho creato il seguente codice per implementare uno spoiler nel mio forum, con firefox funziona a dovere, senza alcun tipo di problema. Con Chrome invece dopo aver clickato "Mostra", non torna il tasto "Nascondi", resta sempre "Mostra". Voglio dire... funziona uguale ma ha solo questo piccolo difetto che se riuscissi a correggere sarebbe perfetto. Chi mi aiuta?
Questo è il replacement:
Come dicevo, in Firefox è ok, come vedete dopo fatto click su "Mostra" appare "Nascondi":codice:<div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px; width:852; height:26"><right><font color="red"></font></right> <span lang="fa">Spoiler: </span><input type="button" value="Mostra" style="width:59px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Nascondi'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Mostra'; }"> </div> <div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;"> <div style="display: none;"> {param} </div> </div> </div>
http://i1341.photobucket.com/albums/...ML/spoilff.jpg
Mentre con Chrome, se si clicka "Mostra", il testo spoiler appare ma il tasto resta "Mostra".
http://i1341.photobucket.com/albums/...ML/spoilch.jpg
Come potrei risolvere? Grazie in anticipo.

Spoiler: </span><input type="button" value="Mostra" style="width:59px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Nascondi'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Mostra'; }">
</div>
<div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;">
<div style="display: none;">
{param}
</div>
</div>
</div>
Rispondi quotando