<script type="text/javascript"> $(document).ready(function(){ var newTab = []; /* setup newTab.push([ 'Roster', 'Google', 'http://www.google.com', true ]); 'Roster' = tab to add the new one after 'Google' = new tab name 'http://...' = new tab URL true = set to true to open link in a new window, set to false to open it in the same window - NO QUOTES! */ newTab.push([ 'Roster', 'Google', 'http://www.google.com', true ]); newTab.push([ 'Google', 'Bing', 'http://www.bing.com', true ]); newTab.push([ 'Bing', 'Yahoo', 'http://www.yahoo.com', true ]); newTab.push([ 'Yahoo', 'Help Site', '/Guild.aspx?GuildID=258012', true ]); // Don't change anything below var j, tar, win; for (j=0; j<newTab.length; j++){ tar = $('.straightBarWrapperInnerTable').find('a:contains(' + newTab[j][0] + ')') .closest('td').eq(0).addClass('straightBarSpacer'); win = (newTab[j][3]) ? '_blank' : '_self'; // don't clone the active tab because it uses different classes $('.straightBarWrapperInnerTable td:not(.straightBarActiveTab)').eq(0) .clone(true) // include bound events .insertAfter(tar) .addClass('newStraightBarTab straightBarSpacer straightBarNormalTab') .removeClass('straightBarFirstTab') .removeAttr('onclick') // remove onclick attribute .find('a') .attr({ href: newTab[j][2], target: win }) // change link location/target .html(newTab[j][1]); } // fix tab click function $('.straightBarWrapperInnerTable').find('.newStraightBarTab').click(function(){ var lnk = $(this).find('a')[0]; window.open( lnk.href, lnk.target ); return false; }); }); </script>
If you want to link to another GuildPortal site, use this link format (using only the GuildID): /Guild.aspx?GuildID=###### This format allows you to stay logged into both accounts. If you use your domain name (mine would be http://mottie.guildportal.com) then you and your users may have to keep logging into the site.
alrighty cool! thanks,
now I got one little problem though!
I get to see the Link_4 button like 50 times!
<
blockquote
>
script
type
=
"text/javascript"
$(document).ready(function(){
var tabAfter = "Home";
var tabName = "Link_";
var tabURL = "Link_1";
var newWindow = false;
// Don't change anything below
var tar = $('.straightBarWrapperInnerTable').find('a:contains(' + tabAfter + ')').closest('td'),
win = (newWindow) ? '_blank' : '_self';
tar
.clone(true) // include bound events
.insertAfter(tar)
.find('a')
.attr({ href: tabURL, target: win }) // change link location/target
.html(tabName);
// change tab onclick function
tar.next()[0].onclick = function(){ window.open(tabURL, win); };
});
</
var tabAfter = "Link_1";
var tabName = "Link_2";
var tabURL = "Link_2";
var tabAfter = "Link_2";
var tabName = "Link_3";
var tabURL = "Link_3";
var tabAfter = "Link_3";
var tabName = "Link_4";
var tabURL = "Link_4";