Youtube Spoiler Fancy
What this does
This code will turn all of your Youtube embed code into fancy spoiler that users can click to open and close to view the Youtube video. Screenshots INSTALL Please back up your "bbcode_video" code before making any edits so you can restore if mistakes happen. IMAGES Upload the images to your images folder YT_open.jpg YT_close.jpg CODE In admincp » Styles & Templates » Style Manager » Edit Templates » BB Code Layout Templates » bbcode_video Find: line 8 HTML Code:
<vb:elseif condition="$provider == 'youtube'" />
HTML Code:
<iframe title="YouTube video player" width="640" height="360" src="//www.youtube.com/embed/{vb:raw code}?wmode={vb:raw wmode}" frameborder="0" allowfullscreen></iframe> HTML Code:
<div style="padding-top:4px;padding-right:4px;"> <div> <img name="YouTube Spoiler" type="image" src="images/YT_open.jpg" 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.src = 'images/YT_close.jpg'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = '';this.src = 'images/YT_open.jpg'; }"> </div> <div style="margin: 0px; padding:0px;"> <div style="display: none;"> <iframe title="YouTube video player" width="640" height="360" src="//www.youtube.com/embed/{vb:raw code}?wmode={vb:raw wmode}" frameborder="0" allowfullscreen></iframe> </div> </div> </div> I have included the code and images in the attachment. Just to clarify this does not help with page load times. This is my first post if I have made any mistakes please let me know. Download
YTS.zip (459.7 KB, 23 downloads) |
Similar Mods
Fancy iMac | vBulletin 3.6 Styles |
Fancy Grey - side menu | vBulletin 3.5 Styles |
Fancy Blue skin | vBulletin 3.5 Styles |