Hey Guys -
I want to be able to have a different icon next to my link when you are on
that page. I have a javascript that I modified, but it is not working. I
had to modify the output for document.write to include my rollovers, and I
have a feeling that is where my problem is. Escaping quotes, etc. tend to
trip me up.
The original script included a "links_url" but I opted not to use that and
just used the "links" variable with the page extension (.asp) behind it,
hoping to keep it simpler (or not).
The original script said to insert <script language="javascript"
src="/includes/inc_nav.js"></script> where you need the menu to appear,
which is what I did. However, when I load the page I get no error, and no
menu. When I do a view source the call to the script (above) is there, but
nothing in terms of menu or images.
If anyone has any thoughts, or a better script to use, I would be forever
grateful.
Thanks,
Todd
****************************************************************************
***************************************
/* The link details */
var links = new Array ("page", "page2", "page3");
var links_alt = new Array ("Return to Home", "Go to Page 2", "Go to Page
3");
var links_url = new Array ("home.asp", "page2.asp", "page3.asp");
/* Resolve the location */
var loc=String(this.location);
loc=loc.split("/");
loc=loc[loc.length-1].split(".");
loc=loc[loc.length-2];
/* Menu generating function */
function dyn_menu_gen()
{
for(var i=0; i<links.length; i++)
{
if(loc==links[i])
{
document.write('<img src="/images/menu_checked.gif" width="17"
height="15" border="0" />
<a href="/' + links[i] + '.asp"
onmouseout="MM_swapImgRestore()"
onmouseover="MM_swapImage(\'' + links[i]
+ '\',\'\',\'/images/' + links_alt[i] + '_on.gif\',1)">
<img src="/images/' + links[i] +
'_off.gif" alt="' + links_alt[i] + '" name="'
+ links[i] + '" width="113" height="15"
border="0" id="' + links[i] + '" /></a>');
}
else
{
document.write('<img src="/images/menu_box.gif" width="17"
height="15" border="0" />
<a href="/' + links[i] + '.asp"
onmouseout="MM_swapImgRestore()"
onmouseover="MM_swapImage(\'' + links[i]
+ '\',\'\',\'/images/' + links_alt[i] + '_on.gif\',1)">
<img src="/images/' + links[i] +
'_off.gif" alt="' + links_alt[i] + '" name="'
+ links[i] + '" width="113" height="15"
border="0" id="' + links[i] + '" /></a>');
}
<br>
}
}
/* Generate the menu */
dyn_menu_gen();
____ The WDVL Discussion List from WDVL.COM ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
Send Your Posts To: [email protected]
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk
________________ http://www.wdvl.com _______________________
You are currently subscribed to wdvltalk as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016
Please include the email address which you have been contacted with.