Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need help fixing the error in this script. 1

Status
Not open for further replies.

DrySnot

Technical User
Nov 29, 2007
46
<script type="javascript"><!--

browserName = navigator.appName;

browserVer = parseInt ( navigator.appVersion );



version = "n2";

if ( browserName == "Netscape" && browserVer >= 3 ) version = "n3";

if ( browserName == "Microsoft Internet Explorer" && browserVer >=4 ) version = "e4";



if ( version == "n3" || version == "e4" )

{



about_on = new Image ( 134, 94 );

about_on.src = "menuimages/about_on.gif";

products_on = new Image ( 72, 69 );

products_on.src = "menuimages/products_on.gif";

news_on = new Image ( 134, 70 );

news_on.src = "menuimages/news_on.gif";

links_on = new Image ( 134, 94 );

links_on.src = "menuimages/links_on.gif";

guestbook_on = new Image ( 134, 94 );

guestbook_on.src = "menuimages/guestbook_on.gif";

email_on = new Image ( 134, 70);

email_on.src = "menuimages/email_on.gif";





about_off = new Image ( 134, 94 );

about_off.src = "menuimages/about_off.gif";

products_off = new Image ( 134, 108 );

products_off.src = "menuimages/products_off.gif";

news_off = new Image ( 134, 70 );

news_off.src = "menuimages/news_off.gif";

links_off = new Image ( 134, 94 );

links_off.src = "menuimages/links_off.gif";


guestbook_off = new Image ( 134, 108 );

guestbook_off.src = "menuimages/guestbook_off.gif";

email_off = new Image ( 134, 70 );

email_off.src = "menuimages/email_off.gif";






}



function button_on ( imgName )

{

if ( version == "n3" || version == "e4" )

{

butOn = eval ( imgName + "_on.src" );

document
.src = butOn;

}

}



function button_off ( imgName )

{

if ( version == "n3" || version == "e4" )

{

butOff = eval ( imgName + "_off.src" );

document
.src = butOff;

}

}

// --></script>
 
Thank you so much for taking the time to look at this for me. I am also trying to remove all the old code that is no longer needed.

I link to my under construction page is here
 
Where did you get that antique code? Delete the browser checks.

Code:
function button_on ( imgName )
{

document.images[img]ame[/img].src = document[img]ame + '_on'[/img].src;

}

Lee
 
Made a mistake there. Should be

Code:
function button_on ( imgName )
{

document.images[img]ame[/img].src = [red]window[/red][img]ame + '_on'[/img].src;

}

Lee
 
Thanks you so much for the help man you are amazing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top