jquery.appear icon indicating copy to clipboard operation
jquery.appear copied to clipboard

Allow scrollable viewports different from window

Open elhoyos opened this issue 12 years ago • 5 comments

elhoyos avatar Feb 27 '13 14:02 elhoyos

@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;

morr avatar Mar 23 '13 07:03 morr

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

rickhall avatar Apr 24 '13 12:04 rickhall

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

elhoyos avatar Apr 24 '13 12:04 elhoyos

:+1: seems like this would really complete this plugin

cm325 avatar Oct 10 '13 15:10 cm325

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.

elhoyos avatar Dec 02 '13 20:12 elhoyos