loading to test
Announcement
Collapse
No announcement yet.
Spoiler BBCode
Collapse
This is a sticky topic.
X
X
-
- Top
- Translate
- Bottom
Comment
-
I spent several hours tinkering with a spoiler tag code last night, I'm not using yours currently but I'm curious to know how difficult it is to add the ability to change the text on the spoiler tag to a user-defined text?
[spoiler=example]spoiler here[/spoiler]
Would yield the word "spoiler" on the tag being replaced with "example" instead.
I've tried messing around with {param} and {option} but can't seem to get it functioning. x.x
-edit-
Just to be clear about the use for it and why I'd like to be able to do this. Other than hiding spoilers, we use an expandable/collapsable spoiler tag to condense longer posts and large images as well. It would be useful to name the spoiler tag with a brief description of the contents as opposed to having to type it out below it. I was on another website about 5 years ago that had this option, and it was pretty great.
- Top
- Translate
- Bottom
Comment
-
Do you want something like thisthat does exactly this kind of Spoiler BBCode? If so, here is the codeyou just have to replace "SPOILER" with {option} in the original replacement code in the first post and enable "Use {option}" setting. See the code below.
HTML Code:<span style="cursor:pointer; border:1px solid red;padding:2px; color:red" onclick="this.nextSibling.style.display='';this.style.display='none'" title="Click to show content">{option}</span><span style="display:none; cursor:pointer; border:1px dotted #000; padding:2px" onclick="this.previousSibling.style.display='';this.style.display='none'" title="Click to hide content">{param}</span>
Last edited by glennrocksvb; 08-28-2018, 07:52 AM.Helpful? Donate. Thanks!
Fast VPS Host for vBulletin:
A2 Hosting & IONOS
- Top
- Translate
- Bottom
- Likes 1
Comment
-
Hi, I'm using vB 4.2.5
This works perfectly, however when there is no text above or below it.. it displays it as such:
Then if I add any text all at above the spoiler tags
Same applies to the bottom, so basically it works fine as long as there is text both above and below the tags
Any ideas on how to fix that?
- Top
- Translate
- Bottom
Comment
Users Viewing This Page
Collapse
There is 1 user viewing this forum topic.
- Guest
Latest Posts
Collapse
-
Reply to Topic Starter Ribbon for vBCloudby MitchGood Day Glenn!! I implemented the above hook #1-#10. My font style and size changed when typing a reply to a post. Not sure if it also changed in other...Today, 03:25 AM
-
Reply to Topic Starter Ribbon for vBCloudby glennrocksvbMitch I've added the fix for this mod. Please refer to the "Fix for vB 6.0.4 and later" section in the updated first post....Yesterday, 10:26 PM
-
Get Affordable and Fast VPS for vBulletin
Comment