/    Sign up×
Community /Pin to ProfileBookmark

problem with scrollTo method in IE

Hello,

I need to scroll the browser window up and am wondering why the following code doesn’t work in IE 6+ on Windows. It seems to work ok in Safari and Firefox and even IE 5.5 on the mac. Does IE (win) not support the scrollTo method?

function scrolldown() {
window.scrollTo(0,0)
}

<body onLoad=”scrolldown();>

For those of you who are wondering why I’m trying to do this, here is the situation. The page loads an iFrame with a linked external page including a target anchor to content low on the external page. This anchor in the external page that loads in the iframe is causing the main browser window to scroll down as well, and I don’t want that to happen. I need the top of the main page to be visible, and for only the iframe content to scroll to its anchor, if that makes any sense.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@jeplerauthorDec 22.2006 — solution posted here [URL=http://mytechmusings.blogspot.com/2006/12/iframe-scroll-to-anchor-problem.html]http://mytechmusings.blogspot.com/2006/12/iframe-scroll-to-anchor-problem.html[/URL]
×

Success!

Help @jepler spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...