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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:58:39+00:00 2026-05-15T18:58:39+00:00

I want to be able to find out when a page element is on

  • 0

I want to be able to find out when a page element is on or off the viewers screen. Specifically, I’d like to be able to “turn off” an html 5 canvas (Processing.js) script if the user has scrolled past the canvas and back on when it is visible again in the users browser.

Does this make sense? I am thinking that there must be some way for the DOM to fire off a notification via ajax to turn on and off the canvas script.

thanks.

///////////
EDIT (final code)
//////////
Here is the final code that I used:

$(window).bind('scroll', function(){
   var $canvas = $('#canvas');
   var pos     = $canvas.offset();
   var total = pos.top + $($canvas).height();
   var wndtop  = $(this).scrollTop();

   if(wndtop <= pos || wndtop >= total ){ 

   }

});
  • 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-05-15T18:58:40+00:00Added an answer on May 15, 2026 at 6:58 pm

    You can attach an event handler to the window scrolling. Like

    $(window).bind('scroll', function(){
       var $canvas = $('#hlogo');
       var pos     = $canvas.offset();
       var wndtop  = $(this).scrollTop();
       var wndleft = $(this).scrollLeft();
    
       if(wndtop <= pos.top && wndleft <= pos.left)
          $canvas.hide();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to find out how long a page will take
I want to be able to find out if an event is hooked up
I want to be able to find out which DOM elements are present in
I want to be able to limit Perl's File::Find to a directory depth (below
In VS2003, I am trying to find out the particular page where the request
This seems like a simple question, but I haven't been able to find the
I have a URL, and I want to get the final page name out
I need to find out from which page the request is coming from. For
I have a control that I'm writing where I want to turn off .NET's
I want to be able to do Artist.case_insensitive_find_or_create_by_name(artist_name) [1] (and have it work on

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.