Michael Moderator
Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
pmvForum | Color Drop Down v1 (21st Mar 08 at 9:27pm UTC) | | This will add a color drop down to the right of the UBBC buttons. Very handy thing to have!
<script> /*Color Drop Down v1 Created By Wrighty No Rip, Repost or Claiming*/
var color = {
list: [ ["Red","FF0000"], ["Green","00FF00"] ],
_s: document.createElement('select'), _d: document.createElement('span'), _p: get('ubbc_buttons','id'), add: { colors: function(){ color._s.options[0] = new Option('Choose Color',''); for(i=0;i<color.list.length;i++){ color._s.options[i+1] = new Option(color.list[i][0],color.list[i][1]); } }, extra_features: function(){ color._d.style.paddingLeft = '20px'; color._s.onchange = function(){ if(color._s.value!=''){ add_ubbc('[color='+color._s.value+']','[/color]'); } }; }, drop_down: function(){ color._d.appendChild(color._s); color._p.firstChild.insertBefore(color._d, color._p.firstChild.getElementsByTagName('br')[0]); } }, build: function(){ if(color._p){ this.add.colors(); this.add.extra_features(); this.add.drop_down(); } } }; color.build(); </script>
To add more colours simply alter the following:
["Red","FF0000"], ["Green","00FF00"] To add 'Blue' you would use this:
["Red","FF0000"], ["Blue","0000FF"], ["Green","00FF00"]
Global Footer | |
|