jquery-beacons
Version:
React when elements scroll into view.
1 lines • 2.16 kB
JavaScript
require=function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){function d(){return void 0===window.pageYOffset?(document.documentElement||document.body.parentNode||document.body).scrollTop:window.pageYOffset}b.exports=function(a,b){var c=d(),e=document.documentElement.clientHeight,f=c+e;b=b||0;var g=a.getBoundingClientRect(),h=g.top+c-b,i=g.bottom+c+b;return i>c&&h<f}},{}],2:[function(a,b,c){var d=a("jquery"),e=a("./types/beacon.js");d.fn.beacon=function(a){return this.each(function(b,c){"enable"===a?c.$b_enable():"disable"===a?c.$b_disable():"destroy"===a?c.$b_destroy():"object"==typeof a&&(a.el=c,e(a))}),this}},{"./types/beacon.js":3,jquery:"jquery"}],3:[function(a,b,c){var d=a("jquery-near-viewport"),e=a("../util/smooth-scroll.js");b.exports=function(a){var b=a.onexit||function(){},c=a.onenter||function(){},f=a.el,g=a.range||0,h=!1,i=!0,j=a.enteronce,k=!1,l=a.exitonce,m=!1;return f.$b_activate=function(){var a=d(f,g),e=j&&k,n=l&&m;i&&(a&&!h?e||(k=!0,c(f)):!a&&h&&(n||(m=!0,b(f)))),h=a,e&&n&&f.$b_destroy()},f.$b_destroy=function(){f.$b_activate=function(){}},f.$b_disable=function(){i=!1},f.$b_enable=function(){i=!0},e(function(){f.$b_activate()}),f}},{"../util/smooth-scroll.js":4,"jquery-near-viewport":1}],4:[function(a,b,c){(function(c){var d=a("jquery");b.exports=function(a){var b=!1;a=a||function(){},d(c.window).on("scroll",function(){b||(b=!0,c.requestAnimationFrame(function(){a(),b=!1}))}).trigger("scroll")}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{jquery:"jquery"}],jquery:[function(a,b,c){(function(a){b.exports=a.jQuery}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[2]);