The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Spoiler tag without javascript?
A few users have said the spoiler tag isn't working, and I suspect it is because their phone doesn't allow it. Is it possible to do it without javascript? Or what is the best way to handle this issue?
Right now this is what we're using: Code:
<div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: <input type="button" value="Show" style="width:45px;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 = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"> </div> <div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;"> <div style="display: none;"> {param} </div> </div> </div> |
#2
|
|||
|
|||
I'm sure you'll see many different variations for this but here's what I use
Code:
<div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px; width:852; height:26"><right><font color="red"><b> </b></font></right> <input type="button" value="Spoiler" style="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 = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Spoiler'; }"> </div> <div> <div style="display: none;"> {param} </div> </div> </div> Edit: didn't look at the entire code but it looks exact same almost but I have no issues on either vb3 or vb4 forum on mobile. |
#3
|
|||
|
|||
It's not possible to do this without JavaScript, it needs to catch the onclick event on the button so it can then open/close the div with the content.
|
#4
|
|||
|
|||
Thanks for the replies. For anyone using a spoiler, have you ever had any complaints about people who click and nothing happens? I suspect it is due to their browser not allowing javascript. Is this the case?
|
#5
|
|||
|
|||
It's highly unlikely that someone has JavaScript disabled. JavaScript is enabled on pretty much all desktop and mobile browsers nowadays, unless they manually disabled it in the settings.
|
#6
|
|||
|
|||
Guess it all depends what they were trying to show. If it was flash related then it would show as blank image. Only certain mobile web browser's will show flash content.
|
#7
|
|||
|
|||
Looks like it is the mobile theme disabling it.
When using the desktop version the spoilers work fine. When using mobile the mobile theme, it doesn't. What's the quickest way to solve this issue? Thanks. |
#8
|
|||
|
|||
I don't really understand what's going on there, but it seems like in the mobile style, the big area that say "Show" is not the thing that needs to be clicked to show it. There's another <input> tag that's not showing up at all.
|
#9
|
|||
|
|||
The example posted is 3 different kinds of spoiler tags, including the one I posted above, and the one Outl4w posted. What is the best way to resolve this? No idea why when clicked the input doesn't show. Thanks.
|
#10
|
|||
|
|||
bump, thanks.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|