Post by Matt on Jun 13, 2006 16:19:43 GMT -5
Created By: Aaron
Creator's Comments:
Description: Adds new menu icons (or text links) to the menubar.
Cross-browser: Yes
Global Header
To add new menu icons repeat this line directly under the blue text in the code:
new addIcon("INSERT BEFORE/AFTER", "LINK", "IMAGE");
To add new text links repeat this line directly under the blue text in the code:
new addText("INSERT BEFORE/AFTER", "LINK", "TEXT");
Example:
new addText("after", "http://www.google.com", "Google");
Creator's Comments:
Description: Adds new menu icons (or text links) to the menubar.
Cross-browser: Yes
Global Header
<script type="text/javascript">
<!--
// Additional Links in Menubar
function addIcon(nPlacement, nHref, nSrc)
{
var nAnchor = document.createElement("a");
nAnchor.href = nHref;
var nIcon = document.createElement("img");
nIcon.src = nSrc;
nIcon.border = "0";
nAnchor.appendChild(nIcon);
if(nPlacement.match(/after$/i))
{
document.getElementsByTagName("td")[5].appendChild(nAnchor);
document.getElementsByTagName("td")[5].appendChild(document.createTextNode(" "));
}
if(nPlacement.match(/before$/i))
{
document.getElementsByTagName("td")[5].firstChild.insertBefore(document.createTextNode(" "), document.getElementsByTagName("td")[5].firstChild.firstChild);
document.getElementsByTagName("td")[5].firstChild.insertBefore(nAnchor, document.getElementsByTagName("td")[5].firstChild.firstChild);
}
}
function addText(nPlacement, nHref, nText)
{
var nAnchor = document.createElement("a");
nAnchor.href = nHref;
var nTextNode = document.createTextNode(nText);
nAnchor.appendChild(nTextNode);
if(nPlacement.match(/after$/i))
{
document.getElementsByTagName("td")[5].appendChild(nAnchor);
document.getElementsByTagName("td")[5].appendChild(document.createTextNode(" "));
}
if(nPlacement.match(/before$/i))
{
document.getElementsByTagName("td")[5].firstChild.insertBefore(document.createTextNode(" "), document.getElementsByTagName("td")[5].firstChild.firstChild);
document.getElementsByTagName("td")[5].firstChild.insertBefore(nAnchor, document.getElementsByTagName("td")[5].firstChild.firstChild);
}
}
// Add new links below
new addIcon("INSERT BEFORE/AFTER", "LINK", "IMAGE");
//-->
</script>
To add new menu icons repeat this line directly under the blue text in the code:
new addIcon("INSERT BEFORE/AFTER", "LINK", "IMAGE");
To add new text links repeat this line directly under the blue text in the code:
new addText("INSERT BEFORE/AFTER", "LINK", "TEXT");
Example:
new addText("after", "http://www.google.com", "Google");