javascript errors?

A

Anthony Speiser

On our website, using page include for left side hyperlinks with mouseovers,
mouse overs work on some pages, but give errors on others.

example of one that works: www.newingtoncropsey.com
one that doesn't: www.newingtoncropsey.com/academy.htm

As an include page, I am confused as why is works on some, but not other
pages??

any help would be appreciated

Anthony Speiser
Newington Cropsey Foundation
 
J

Jack Brewster

I'm not sure why you're getting errors, but I do wonder why you're using JS
for this effect. Your links are plain text. The rollover effect could be
_easily_ achieved using Cascading Style Sheets (CSS). It looks like your
page is already using styles, anyway.

You could probably reduce your page size quite a bit as well. Instead of
this:
<p dynamicanimation="fpAnimformatRolloverFP1"
fprolloverstyle="background-color: #B8CCED" onmouseover="rollIn(this)"
onmouseout="rollOut(this)" language="Javascript1.2">
<span lang="en-us">
<a href="cradle/cradle.htm" style="text-decoration: none">
<font size="2">Cradle of Genius</font></a></span></p>

You could just have this:
<a href="cradle/cradle.htm" class="menulink">

and add this to your CSS file:

..menulink a {
display: block;
font-size: <some size that works>;
text-decoration: none;
background: <default background color>;
color: white;
}

..menulink a:hover {
background: <background color>;
color: <text color>;
}

The only place this wouldn't work is Netscape 4 since it doesn't support the
:hover pseudo-class. But in everything else, it would work regardless of
the status of JavaScript.

For more info on styling links, check out:
http://www.w3schools.com/css/css_pseudo_classes.asp

Good luck!
 
T

Thomas A. Rowe

1. See Jack's response.

The FP scripts that handle the rollover effect is missing from the page that
doesn't work. You must add the script to every page.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
V

Very Joyful \(Victoria\)

Jack has given you a much better solution.

Here's another point... it looks like you have the same menu on both pages,
and I'm guessing you have the same menu on many pages. You should put the
menu on a page all by itself and then include it on each page as an Include
Page. Then when you need to change the menu, you only have to change it
once.
 
A

Anthony Speiser

Thomas,

Thanks for the response. I tried adding it by typing and then by copy/paste
from one page to the other in HTML view, but when I save the page, it
disappears! I have checked compatability settings on the pages, thinking
this was throwing things off, but they are set identically. Can I type
javascript code directly in HTML view, or is there some other method I
should be using? It seems strange that I think I used the "include page"
method to insert top, left and bottom into each page, yet some work and some
don't.

Thanks again

Anthony Speiser
 
A

Anthony Speiser

Jack

Thanks for the suggestion - I will try it. I came about doing the site this
way as I knew JS better than CSS when I started redesigning, and am now
learning CSS, but have not incorporated everything into the style sheet yet.

Thanks again

Anthony Speiser
 
T

Thomas A. Rowe

The problem that the actual navigation is in a include page which would
normal have a link to the java script in the head section of the page it is
inserted on, in this case that would be the Include Page, but only the
content between the <body>..</body> tags is included in other pages.

In order to have this work correctly, you may need to copy the JavaScript to
notepad and save as a external .js file and then create and place a link to
this external .js file into head section of all pages using the include
page.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 

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

Top