2011-11-17, 05:43 PM
With help from ranjani we made two buttons for the post bit template, with the first button you're able to open all spoilers on the page and with the second you're able to close all spoilers on the page. The code is:
What I need is help integrating both buttons the same way MyBB does their "multiquote", it's one button that changes the image on click and does the opposite on click. I need this, make it so you click it once all images open and the images changes to the red one, user clicks again and the second code functions where everything closes and the blue buttons goes back.
<a href="javascript:var%20btn=document.getElementsByTagName('input');for(var%20i%20in%20btn){if(btn[i].value==%22Show%22){btn[i].click();}else{}}"><img src="http://upit.cc/i/89d0219f.png" alt="Open all spoilers" title="Open all spoilers"></a><a href="javascript:var%20btn=document.getElementsByTagName('input');for(var%20i%20in%20btn){if(btn[i].value==%22Hide%22){btn[i].click();}else{}}"><img src="http://upit.cc/i/43b973a1.png" alt="Close all spoilers" title="Close all spoilers"></a>
What I need is help integrating both buttons the same way MyBB does their "multiquote", it's one button that changes the image on click and does the opposite on click. I need this, make it so you click it once all images open and the images changes to the red one, user clicks again and the second code functions where everything closes and the blue buttons goes back.