The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Dynamically change widget header while widget is active
I'm not sure if anyone has done this before but I thought I'd pass it along anyway.
I created a new Static HTML widget and didn't like the HTML icon. I saw a few posts that suggested creating a new template etc..etc.. but that wasn't going to work for my application. Here's an easy way to change the widget header on the fly even when it is active. Just go into the vbcms_widget_static_page section of your template and add the span tags around the header title line and give the span a name <span id="mywidgetheader"> <h3><img src="{vb:stylevar imgdir_siteicons}/html.png" alt="" /> {vb:raw widget_title}</h3> </span> then in your HTML widget just add a function with code like this that changes the contents of the span: document.getElementById('mywidgetheader').innerHTM L = '<h3><img src="{vb:stylevar imgdir_siteicons}/html.png" alt="" />This is my new header</h3>'; This will allow you to change the header while the widget is active. --------------- Added [DATE]1336195655[/DATE] at [TIME]1336195655[/TIME] --------------- Update...I was able to put a marquee in the widget header as follows. Works fine without any problems. document.getElementById('mywidgetheader').innerHTM L = '<H3><marquee behavior="scroll" direction="left" scrollamount=2>This is a test of changing the widget header while active...</marquee></H3>'; |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|