Skip to content
This repository was archived by the owner on Aug 9, 2022. It is now read-only.
This repository was archived by the owner on Aug 9, 2022. It is now read-only.

Enter event firing for all elements matching selector even if outside of container #76

@gavin310

Description

@gavin310

I'm not sure if this is expected functionality or a bug. I initialize my OnScreen object using a container. In this case my container is a jQuery object named wrap. As soon as the enter event is set, all elements in my HTML with the class .reveal get immediately triggered, even if they are not inside of my container element. Is this correct? I assumed that only elements inside the container would be handled.

var os = new OnScreen( {
	tolerance : 100,
	debounce : false,
	container : wrap.get( 0 ),
} );
os.on( 'enter', '.reveal', function( elem, evt ) {
	$( elem ).addClass( 'active' );
} );

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions