2010-02-05 6 views
0

Guys! Mon problème est optimizaiton de ce code pour IE 8 (avec IE 8 le premier bouton est ok, mais le second ne fonctionne pas), Google Chrome (deuxième bouton est ok, mais d'abord ne fonctionne pas). J'ai empilé avec, aidez s'il vous plaît. :)Problème avec l'optimisation des boutons sur la page du site Web

premier bouton

<div id="spoiler"> 
<div> 
<p style="text-align: center;"><input style="margin: 10px; padding: 0px; width: 150px; font-size: 12px; background-color: #fdeaa8;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = ''; this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = 'none'; this.innerText = ''; this.value = 'hide spoiler'; } else { this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = 'none'; this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = ''; this.innerText = ''; this.value = Show again?'; }" type="button" value="Elaya company" /></p> 

<div> 
<div id="show" style="border-style: solid; border-width: 1px; margin: 0px; padding: 4px; display: none; background-color: transparent; width: 98%;"> 

</div> 

BOUTON DEUXIÈME

<div id="spoiler"> 
<div> 
<p style="text-align: center;"><input style="margin: 10px; padding: 0px; width: 150px; font-size: 12px; background-color: #fdeaa8;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = ''; this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = 'none'; this.innerText = ''; this.value = 'Hide spoiler'; } else { this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = 'none'; this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = ''; this.innerText = ''; this.value = 'Show again?'; }" type="button" value="AssolModa company" /></p> 

<div id="show" style="border-style: solid; border-width: 1px; margin: 0px; padding: 4px; display: none; background-color: transparent; width: 98%;"> 

Répondre

0

Est-ce une citation directe de votre code? Parce que l'examiner, je peux immédiatement voir que dans le code javascript Button 1, il y a un «manquant près de la fin, dans this.value = Show again?'; (devrait être this.value = 'Show again?';). Envisager de réparer cela et voir si quelque chose change.

Questions connexes