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

Allow scrollable viewports different from window #8

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

elhoyos
Copy link
Contributor

@elhoyos elhoyos commented Feb 27, 2013

No description provided.

@morr
Copy link
Owner

morr commented Mar 23, 2013

@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

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

@elhoyos
Copy link
Contributor Author

elhoyos commented Apr 24, 2013

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

@cm325
Copy link

cm325 commented Oct 10, 2013

👍 seems like this would really complete this plugin

@elhoyos
Copy link
Contributor Author

elhoyos commented Dec 2, 2013

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