Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8708231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:04:43+00:00 2026-06-13T04:04:43+00:00

this question is very similar to many other questions posted on stack overflow,I have

  • 0

this question is very similar to many other questions posted on stack overflow,I have found about a few solutions that I based my code on but no help with what I’m searching for on, Overstack , yelotofu and a few similar posts … (This is kind of related to another question I’ve posted a few days ago but I’m pretty sure it’s inactive by now since I got my answer so).

So I’ve basically created an ajax chat application and I want the scroll bar of a div to check if it’s at the button and if it is show the message then scroll. I have found 3 main ways to do this(removed one of them because the basics of it were the same as the others)

either:

    if($("#chatscreen")[0].scrollHeight - $("#chatscreen").scrollTop() == $("#chatscreen").outerHeight())
    {
    alert("work");
    }

or

$("#chatscreen").scroll(function(){
    if($(this)[0].scrollHeight - $(this).scrollTop() == $(this).outerHeight())
    {
    alert("work");
    }
});​

I have tested the first code on firefox, internet explorer and chrome, it worked great on firefox and internet explorer but not on chrome.

The only real difference between them is $("#chatscreen").scroll(function(){ which basically keeps executing the script when the scrollbar is being used and for some reason this worked while bugging all 3 browsers I have tried making them unusable.

And so I’ve been trying to find a good alternative that could work on both firefox, chrome and internet explorer.

Thank you for any help/advice you can provide.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:04:44+00:00Added an answer on June 13, 2026 at 4:04 am

    I figured out why it wasn’t working, on chrome

    $("#chatscreen")[0].scrollHeight - $("#chatscreen").scrollTop() == $("#chatscreen").outerHeight()

    was false, Still not sure why it works when we added the .scroll() but well the above equation needed to be changed by adding a -1 to the end result to make it work.

    Writing this here because it might help someone some day…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that this is a repeated question. I have found very similar questions
I know that this question is very similar to the question posted here .
I had asked a question very much similar to this in the thread: https://stackoverflow.com/questions/11259474/store-the-numericals-in-char-array-into-an-integer-variable-in-vc
very similar to this question, but not quite the same. I have Musician and
This question sounds similar to many posed here, but it's obnoxiously different. I have
This question is very similar (or almost identical) to In a non blocking socket
This question is very similar to an earlier question I asked ( This Question
My question is very similar to this question - Addin parameter for Oracle except
This is a very similar question to this SO thread on middleware and views
My question popped up a very similar question, this one . But the accepted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.