MyBB Community Forums

Full Version: [Snippet] Spoiler > 2 quotes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Wrote this whilst I had not internet, it's free to use, give credits if you want I don't mind too much as it's damn ugly.

You'll need jQuery inserted to make it work.
Put it in headerinclude or where ever you may want it.

jQuery(function() {jQuery('blockquote:has(blockquote)').each(function(a,b) {
   quote = jQuery(this).parent('blockquote').children('blockquote').first()
   quote.html("<div><div class=\"spoiler_header\">Too Many Quotes <a href=\"javascript:void(0);\" onclick=\"javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display!='block')parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.parentNode.style.display='none';\">(Click to View)</a></div><div class=\"spoiler_body\" style=\"display: none;\">"+quote.html()+"</div></div>")
})});

Also the quote = is only to save dom speed instead of making jQuery look it up more than once.

Looks like:
[Image: R0rqTwl.png]

I can't remember who's spoiler code I used, so sorry can't credit you Sad
This isn't working for me. Can someone help me? :/