|
<script type='text/javascript'> /*Add Menu Buttons Do not redistribute without the creator's permission CRAzY_J ~ ssdesigns.proboards17.com Open Source*/
function addo(link,ilink){ var Img=document.createElement('img'); var Href=document.createElement('a'); Href.href=link; if(ilink.match(/^(http|www)/i)){ Img.src=ilink; Img.border='0'; Href.appendChild(Img); }else{ Href.innerHTML=ilink; } document.body.getElementsByTagName("td")[5].firstChild.appendChild(Href); }
addo('LINK','IMAGE LINK'); addo('LINK','IMAGE LINK'); </script>
Keep the copyright in there please
|
|
|
|
A lot more controllable.  <script type='text/javascript'> /*Add Menu Buttons Do not redistribute without the creator's permission CRAzY_J ~ http://ssdesigns.proboards17.com Open Source*/
function addo(link,ilink,classI,opt){ var Img=document.createElement('img'); var Href=document.createElement('a'); Href.href=link; if(ilink.match(/^(http|www)/i)){ Img.src=ilink; Img.border='0'; Href.appendChild(Img); }else{ Href.innerHTML=ilink; } if(classI == "after"){ document.body.getElementsByTagName("td")[5].firstChild.appendChild( document.createTextNode(" ")); document.body.getElementsByTagName("td")[5].firstChild.appendChild(Href); }else if(classI == "before"){ document.body.getElementsByTagName("td")[5].firstChild.insertBefore( Href,document.body.getElementsByTagName("td")[5].firstChild.firstChild); document.body.getElementsByTagName("td")[5].firstChild.insertBefore( document.createTextNode(" "),document.body.getElementsByTagName("td")[5].firstChild.firstChild); }else{ var aTDA = document.body. getElementsByTagName("td")[5].firstChild.getElementsByTagName("A"); for(a=0;a<aTDA.length;a++){ if(aTDA[a].innerHTML.match(new RegExp(classI,"i"))){ if(opt == "after"){ aTDA[a].parentNode.insertBefore( Href,aTDA[a].nextSibling); aTDA[a].parentNode.insertBefore( document.createTextNode(" "),aTDA[a].nextSibling); break; }else if(opt == "before"){ aTDA[a].parentNode.insertBefore( document.createTextNode(" "),aTDA[a]); aTDA[a].parentNode.insertBefore( Href,aTDA[a].previousSibling); break; } } } } }
addo('LINK', 'http://www.proboards.com/v4images/menu/home.gif','after'); addo('LINK', 'http://www.proboards.com/v4images/menu/members.gif','before'); addo('LINK', 'http://www.proboards.com/v4images/menu/profile.gif','help','before'); addo('LINK', 'http://www.proboards.com/v4images/menu/logout.gif','admin','after'); </script>
Last Edit: Nov 26, 2005 21:38:31 GMT by Chris
|
|
|
|
|
If i may ask,if we have that text menu feature on,is there a way to convert this code to fit that too or does it have to be a image?
|
|
|
|
Just don't insert the image URL.  Edit: Actually, insert the text instead of the image URL.
Last Edit: Feb 25, 2006 0:40:17 GMT by Chris
|
|
|
|
|
Ok.I understand.Thank you,CD.I wasn't sure if the text worked.
|
|
|