469,623 Members | 1,004 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

scrollIntoView and Firefox

I've looked and looked and can't find any solution or even mention of this
problem so I'll see if I can find anyone through this group who might have
an idea. I've inherited the job of webmaster for my company. After
downloading Firefox 1.5 I started going through the site and found a section
that didn't work in Firefox but works just fine in IE. Any ideas?

Here's the code to define the function used:

function ScrollTo(name)
{
document.anchors.item(name).scrollIntoView();
}

Then:

<td align=center valign=top>
<map name="ksEmporia">
<area shape="circle" coords="210,149,16"
href="javascript:ScrollTo('emporia2')" alt="Maplewood
Memorial Lawn">
<area shape="circle" coords="293,230,16"
href="javascript:ScrollTo('emporia1')" alt="Charter
Funerals, Emporia">
</map>
<img src="../images/map_emporia.gif" usemap="#ksEmporia">
</td>
...
<table align=center summary="Table used as a layout tool only.">
<!--Section header-->
<tr>
<td colspan=5>
<a name="emporia1">
<h1>Emporia, Kansas</h1>
</a>
</td>
</tr>
Dec 27 '05 #1
1 10014
Jim Satterfield a écrit :
I've looked and looked and can't find any solution or even mention of this
problem so I'll see if I can find anyone through this group who might have
an idea. I've inherited the job of webmaster for my company. After
downloading Firefox 1.5 I started going through the site and found a section
that didn't work in Firefox but works just fine in IE. Any ideas?

Here's the code to define the function used:

function ScrollTo(name)
{
document.anchors.item(name).scrollIntoView();
The way to do this in a robust manner is to verify support for the
document collection and then for the scrollIntoView method:

if(document.anchors && document.anchors.item(name).scrollIntoView)
{
document.anchors.item(name).scrollIntoView(true);
};
}

Then:

<td align=center valign=top>
<map name="ksEmporia">
<area shape="circle" coords="210,149,16"
href="javascript:ScrollTo('emporia2')"


This is not a valid url: try instead

<area shape="circle" coords="210,149,16" href="#emporia2"
onclick="ScrollTo(this.href); return false;" alt="Maplewood
Memorial Lawn">

You may even not need to resort to that custom ScrollTo nor
scrollIntoView after all. I can't see the webapge on which this code is
but it certainly looks like there is no need to use/resort to ScrollTo
nor scrollIntoView.

If you can post an url, that would help.

Gérard
--
remove blah to email me
Dec 27 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by bjarthur | last post: by
1 post views Thread by Steve Murphy | last post: by
reply views Thread by Larry Brown | last post: by
4 posts views Thread by xevi.matavacas | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.