df-visible

WebJar for df-visible

License

License

MIT
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

df-visible
Last Version

Last Version

1.3.0-rc.1
Release Date

Release Date

Type

Type

jar
Description

Description

df-visible
WebJar for df-visible
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/customd/jquery-visible

Download df-visible

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/df-visible/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>df-visible</artifactId>
    <version>1.3.0-rc.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/df-visible/
implementation 'org.webjars.bower:df-visible:1.3.0-rc.1'
// https://jarcasting.com/artifacts/org.webjars.bower/df-visible/
implementation ("org.webjars.bower:df-visible:1.3.0-rc.1")
'org.webjars.bower:df-visible:jar:1.3.0-rc.1'
<dependency org="org.webjars.bower" name="df-visible" rev="1.3.0-rc.1">
  <artifact name="df-visible" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='df-visible', version='1.3.0-rc.1')
)
libraryDependencies += "org.webjars.bower" % "df-visible" % "1.3.0-rc.1"
[org.webjars.bower/df-visible "1.3.0-rc.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bower : jquery jar (1.6.0,)

Project Modules

There are no modules declared in this project.

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:

See the blog article:

Limitations

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

org.webjars.bower

Custom D

Versions

Version
1.3.0-rc.1