- });
-
- };
-
- /* Convenience methods in jQuery namespace. */
- /* Use as $.belowthefold(element, {threshold : 100, container : window}) */
-
- $.belowthefold = function(element, settings) {
- if (settings.container === undefined || settings.container === window) {
- var fold = $(window).height() + $(window).scrollTop();
- }
- else {
- var fold = $(settings.container).offset().top + $(settings.container).height();
- }
- return fold <= $(element).offset().top - settings.threshold;
- };
-
- $.rightoffold = function(element, settings) {
- if (settings.container === undefined || settings.container === window) {
- var fold = $(window).width() + $(window).scrollLeft();
- }
- else {
- var fold = $(settings.container).offset().left + $(settings.container).width();