/    Sign up×
Community /Pin to ProfileBookmark

scrollIntoView() in Mozilla

I have sucessfully developed a php/mysql/javascript chat that appends messages to an iframe.

However, I’ve changed it to scroll a <div>, rather than use an iframe. The appending messages to the divide layer works fine, and the div scrolls good.. however I’m having trouble scrolling to the bottom in Mozilla

[CODE]document.getElementById(“chattext”).scrollIntoView(false);[/CODE]

works perfectly in IE, but not in mozilla.

I read the documentation for mozilla regarding scrollintoview() and it seems they do support it. However, as I mentioned, it does not work, and the JavaScript Console in FireFox provides no error messages.

Could anyone lend me a pointer?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FangAug 05.2005 — Code or a link would be helpful, but try scrolling to the last element in the [I]div[/I].
Copy linkTweet thisAlerts:
@scrotayeauthorAug 06.2005 — using elemementname.scrollIntoView(false); is the solution for others who may like to see the solution.

It appears calling the document isn't necessary, just the element name that you'd like to scroll. Works beautifully in IE and Mozilla, I haven't tested other browsers yet.
×

Success!

Help @scrotaye 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.24,
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,
)...