Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Allow scrollable viewports different from window#8

Open
elhoyos wants to merge 4 commits into
morr:masterfrom
elhoyos:scrollable-viewports
Open

Allow scrollable viewports different from window#8
elhoyos wants to merge 4 commits into
morr:masterfrom
elhoyos:scrollable-viewports

Conversation

@elhoyos

@elhoyos elhoyos commented Feb 27, 2013

Copy link
Copy Markdown
Contributor

No description provided.

@morr

morr commented Mar 23, 2013

Copy link
Copy Markdown
Owner

@elhoyos Can't merge it automatically with github. Could you please fix conflicts?
Also it has error in these lines when viewport equals window.

var viewport_offset = $viewport.offset();
var viewport_offset_left = viewport_offset.left || 0;
var viewport_offset_top = viewport_offset.top || 0;

$(window).offset() returns undefined so viewport_offset.left raises "Cannot read property 'left' of undefined" exception.

var viewport_offset = $viewport.offset();
var viewport_offset_left = viewport_offset ? viewport_offset.left : 0;
var viewport_offset_top = viewport_offset ? viewport_offset.top : 0;

@rickhall

Copy link
Copy Markdown

This would be a very nice addition, any plans on integrating it?

@elhoyos

elhoyos commented Apr 24, 2013

Copy link
Copy Markdown
Contributor Author

I have been a bit busy these days. Will give it some time this weekend.

@cm325

cm325 commented Oct 10, 2013

Copy link
Copy Markdown

👍 seems like this would really complete this plugin

@elhoyos

elhoyos commented Dec 2, 2013

Copy link
Copy Markdown
Contributor Author

Notice these changes provide basic support for viewports. On my side this is enough. You may find some undesirable behavior depending on your needs:

  • Using the plugin multiple times in the document will only remember the last used viewport option.
  • Attaching jquery.appear to elements located inside an element with overflow: auto and using the default viewport option will trigger the appear event even when not all the inner elements are visible.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants