vForums Support > Programming & Coding :: Database of Codes/Hacks/Mods :: > Add Menu Buttons

Add Menu Buttons - Posted By Michael (wrighty) on 30th Dec 07 at 3:05am
Global Header

Adds as many menu buttons as you want...

just repeat:
do_menu('Image Link','Link to page');

Code:
 
  1. <script>
  2. /*Add Menu Buttons
  3. Created By Wrighty
  4. support.virtualforums.co.uk*/
  5.  
  6. var menu = get('menu_buttons','id').getElementsByTagName('font')[0];
  7.  
  8. function do_menu(img_src,link){
  9. menu.innerHTML+= " :: <a href="+link+"><img src='"+img_src+"' border=0></a>";
  10. }
  11.  
  12. do_menu('Image Link','Link to page');
  13. </script>
 

Re: Add Menu Buttons - Posted By Jake (jake) on 16th Feb 08 at 3:10pm
I'm sorry but what if you wan't it to be text instead of an image?

Re: Add Menu Buttons - Posted By Michael (wrighty) on 16th Feb 08 at 4:00pm
I'll code one up in a minute! {Smile}

Re: Add Menu Buttons - Posted By Marc (cr0w) on 16th Feb 08 at 4:12pm
Code:
 
  1. <script>
  2. /*Add Menu Buttons
  3. Created By Wrighty
  4. support.virtualforums.co.uk*/
  5.  
  6. var menu = document.getElementById('welcome_table').getElementsByTagName('td')[2];
  7.  
  8. function do_menu(a_text,link){
  9. menu.innerHTML+= " :: <a href="+link+">"+a_text+"</a>";
  10. }
  11.  
  12. do_menu('Text To Display','Link to page');
  13. </script>
 


{Smile}

Re: Add Menu Buttons - Posted By Jake (jake) on 17th Feb 08 at 4:09pm
Thank-you much!

Re: Add Menu Buttons - Posted By Marc (cr0w) on 17th Feb 08 at 4:15pm
 
Thank-you much!


No problem. {Smile}

Re: Add Menu Buttons - Posted By Michael (wrighty) on 17th Feb 08 at 4:20pm
Thanks Marc! {Smile}

Re: Add Menu Buttons - Posted By Jake (jake) on 17th Feb 08 at 4:27pm
Hey, is there any way to make the text the same as the links on the nav bar.. (like on my site, the "Website" text is a bit smaller than the other links, I don't think this is considered advertising, but it's http://gfx.vforums.co.uk/

Re: Add Menu Buttons - Posted By Michael (wrighty) on 17th Feb 08 at 4:43pm
Code:
 
  1. <script>
  2. /*Add Menu Buttons
  3. Created By Wrighty
  4. support.virtualforums.co.uk*/
  5.  
  6. var menu = document.getElementById('menu_buttons').getElementsByTagName('font')[0];
  7.  
  8. function do_menu(a_text,link){
  9. menu.innerHTML+= " :: <a href="+link+">"+a_text+"</a>";
  10. }
  11.  
  12. do_menu('Text To Display','Link to page');
  13. </script>
 

Re: Add Menu Buttons - Posted By Jake (jake) on 17th Feb 08 at 4:48pm
THANKS =]

Re: Add Menu Buttons - Posted By Michael (wrighty) on 17th Feb 08 at 4:48pm
No problem! {Grin}

Re: Add Menu Buttons - Posted By dog199200 (dog199200) on 18th Feb 08 at 3:11am
just wondering is there a way to get it so that the button is on the right side of the page and the normal buttons are on the left, like on here?

Re: Add Menu Buttons - Posted By Michael (wrighty) on 18th Feb 08 at 7:45am
http://support.virtualforums.co.uk/board/codesubmit/topic/2238/action/view_topic/page/1/add-website-link-to-right-of-menu/

Re: Add Menu Buttons - Posted By dog199200 (dog199200) on 24th Feb 08 at 9:14am
ok heres another one, can you get it so that guests can't see it only logged in members?

Re: Add Menu Buttons - Posted By Michael (wrighty) on 24th Feb 08 at 12:10pm
Go to the requests board please! {Smile}