Newbie problem

M

MaineBoy

Hi! Hope someone out there can give this JavaScript newbie a hand.

The site in question is at http://www.sufumaine.org

All pages are launched from the home page, and the table there within.

The issue is that the client wants only the last link visited to be in
the "visited" color (yellowish)

The site functions now except that, unless if you refresh the page,
all of the visited "links" (they're actually text with frontpage
behavoirs applied) remain in the "visited" color.

I thought perhaps a refresh() might do it, I tried various ways of
changing ALL of the text on a page back to green before changing the
individual item to its new color. I just can't seem to get it.

I'd be interested in the "right way" to do this in the long term, if
there is something fundamental I have overlooked.

More pressing now is a way to fix what's there.

All help is greatfully appreciated.

Thanks to all in advance.

MaineBoy
 
L

Lee

MaineBoy said:
Hi! Hope someone out there can give this JavaScript newbie a hand.

The site in question is at http://www.sufumaine.org

All pages are launched from the home page, and the table there within.

The issue is that the client wants only the last link visited to be in
the "visited" color (yellowish)

The site functions now except that, unless if you refresh the page,
all of the visited "links" (they're actually text with frontpage
behavoirs applied) remain in the "visited" color.

I thought perhaps a refresh() might do it, I tried various ways of
changing ALL of the text on a page back to green before changing the
individual item to its new color. I just can't seem to get it.

I'd be interested in the "right way" to do this in the long term, if
there is something fundamental I have overlooked.

More pressing now is a way to fix what's there.


The right way is to write your own code, instead of letting
FrontPage write code to do what it thinks you want to do.

The simplest fix should be to:

Add this function to the head with the others:

funciton FixHack(id,attribute,value){
var colorOff="#008000"; //hard-coded unvisited color
for(var i=2;i<25;i++){ // hardcoded id range of links
FP_changeProp('id'+i,0,'style.color',colorOff); // set all green
}
FP_changeProp(id,0,'style.color',value); // set this one yellow
}


Then change every call to FP_changeProp() that sets the color to
'#B5AA2D' to a call to FixHack(), using the same arguments.

You have a few cases where you first call FP_changeProp() to set
the color to green, then immediately change it to yellow.
You might want to delete those extra calls.
 
J

Justin Page

Lee:

Did the trick just perfectly. Thanks for your help. Point well taken
on not letting Microsoft "do the walking."

Thanks again.

MaineBoy

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top