iframe anchor scrolls whole page!

C

Cloy

The page I'm having problems with is http://www.pontonline.org/index-
new3.htm

Here's the problem...
A script in the page loads a "calendar" (actually a list of dates)
into an iframe at the right side of the page and then scrolls the list
to today's date. The script is listed below.

Everything works fine except that after the page loads, the main page
(not just the iframe) "jumps" down also -- I assume the anchor link is
causing this.

Any suggestions on a workaround for this? Is there a command I could
use to ensure that only the iframe goes to the named anchor? ...or
even something that will move the main page back to the top?

Thanks, in advance, for your help -Cloy


<script type="text/javascript">
<!--
var date = new Date();
var d = date.getDate();
var day = (d < 10) ? '0' + d : d;
var m = date.getMonth() + 1;
var month = (m < 10) ? '0' + m : m;
var year = date.getFullYear();
document.write('<iframe name="News" width="280" marginwidth="0"
height="280" frameborder="0" marginheight="0" align="left"
scrolling="auto" hspace="0" vspace="0" src="office/calendar-
items.htm#' + month + day + year + '">');
document.write('Your browser does not support inline frames or is
currently configured not to display inline frames.')
document.write('</iframe>')
// -->
</script>
 

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

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top