GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - customd/jquery-visible: A jquery plugin which allows us to quickly check if an element is within the browsers visual viewport regardless of the window scroll position

BranchesTags
Open more actions menu

Latest commit

 

History

39 Commits
39 Commits

Folders and files

NameName
Last commit message
Last commit date
benchmark
benchmark
 
 
examples
examples
 
 
LICENSE.txt
LICENSE.txt
 
 
README.markdown
README.markdown
 
 
bower.json
bower.json
 
 
df-visible.jquery.json
df-visible.jquery.json
 
 
jquery.visible.js
jquery.visible.js
 
 
jquery.visible.min.js
jquery.visible.min.js
 
 
package.json
package.json
 
 

Repository files navigation

Element Onscreen Visibility

This is a jQuery plugin which allows us to quickly check if an element is within the browsers visual viewport, regardless of the scroll position. If a user can see this element, the function will return true.

Documentation

Basic visibility check

This basic check will return true if the entire element is visible to the user (within the visual viewport).

$('#element').visible();

If you'd like to check for ANY PART of the element, you can use the following:

$('#element').visible( true );

The plugin ignores the elements visibility by default. E.g., display:none, visibility: hidden, offsetWidth or offsetHeight is 0). To filter on css visibility, you can use the jQuery :visible selector:

$('#element:visible').visible();

Optionally, you can specify a second parameter to the .visible plugin, which will check whether the element is visible, as well as whether it's within the viewport too.

$('#element:visible').visible( false, true );

Optionally, you can add a third parameter to specify the direction to check for visibility. This can either be 'horizontal', 'vertical' or 'both'. Default is to 'both'.

$('#element').visible( false, false, 'horizontal' );

Demos

The Demos for this plugin live under the examples/ directory. Open them directly in your web browser, or view the following online examples:

  • Basic Demo

See the blog article:

  • Checking if an element is visible on-screen using jQuery

Limitations

Currently, this plugin will not check for visibility in nested scrollable areas, only on the main viewport (window object).

About

A jquery plugin which allows us to quickly check if an element is within the browsers visual viewport regardless of the window scroll position

www.customd.com/articles/13/checking-if-an-element-is-visible-on-screen-using-jquery

Resources

Readme
MIT license
Activity
Custom properties

Stars

978 stars

Watchers

40 watching

Forks

351 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.