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 8492259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:39:59+00:00 2026-06-10T22:39:59+00:00

I have an instant chat program I’ve created with HTML5/CSS, Asynch. Javascript and PHP.

  • 0

I have an instant chat program I’ve created with HTML5/CSS, Asynch. Javascript and PHP. I have an interval that is constantly checking the user’s chat box div is scrolled to the bottom for user convenience. This became a problem when a user wished to scroll up to view previous messages so I tried the onscroll event to stop the interval. I couldn’t get this to work and so have gone the longer way around by using the onmouseover and onmouseout events to start and stop the interval.

This works perfectly fine for desktop computers as they have a visible mouse. For mobile devices however, such as my Windows phone – which the program is primarily designed for, there is an issue as you first have to tap the message box (presumably to first move the invisible mobile mouse over the chat box) and then scroll with the finger movement to scroll unaffected.

This isn’t a major problem as I could inform mobile users to first tap then scroll, but I feel that successfully using the onscroll event would match the usability with desktop users.

Are there known issues with the onscroll event? I dare say I’m familiar with JS events and can use them appropriately, but this is the only event I haven’t managed to get to work, in FF or IE.

Any thoughts or help would be appreciated,
Lee.

Here are the current events that manage the scrollcheck on/off, where ScrollCheck() is the function that checks the scroll position and moves it if not at the bottom and scrollInterval is the global var that holds the id of the interval.

document.getElementById('messages').onmouseover = function()
{
    clearInterval(scrollInterval);
}

document.getElementById('messages').onmouseout = function()
{
    scrollInterval = setInterval(ScrollCheck, 300);
}

I simply replaced the onmouseover event to onscroll without any luck.

  • 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-10T22:40:01+00:00Added an answer on June 10, 2026 at 10:40 pm

    When I make a chat page, I only check the scroll when new messages are added:

    var currentScroll = elem.scrollTop, oldmaxScroll = elem.scrollHeight-elem.clientHeight;
    // add new message(s) here
    var newmaxScroll = elem.scrollHeight-elem.clientHeight;
    if( currentScroll == oldmaxScroll) elem.scrollTop = newmaxScroll;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have put that url http://pvpcoach.com/notification.php in Instant Payment Notification setting in my profile
I have written an app that reads incoming chat(somewhat like an instant messenger), formats
I have a Google Instant style jQuery search script that queries a PHP file
I have a Google Instant style jQuery search script that queries a PHP file
I have a Google Instant style jQuery search script that queries a PHP file
I have created a foreign key with NaviCat (a MySQL application), but the instant
I have a program that allows the user to use a few dropdowns to
I have a TreeMap, that looks like this: TreeMap<Instant, HashMap<Type, Double>> The Instant values
I see that fiver have implemented an instant pay feature with paypal. Does anyone
I have implemented an autocomplete / instant search on a mobile application that I

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.