ic-trigger-on- The Trigger On Attribute
ic-trigger-on attribute tells Intercooler to load the content of a
when a given event occurs.
This can be used to implement infinite scrolling, lazy loading of elements, etc.
The value of the attribute should be a valid JQuery event:http://api.jquery.com/category/events/
Also supported is the special event
scrolled-into-view, which will fire when an element
first scrolls into view.
If a parent element has an
ic-sse-src attribute on it, it is possible to use server sent
events to trigger an element by using the
sse: prefix, followed by the event name.
See the documentation for more details.
ic-trigger-on has no effect on dependencies.
Here is a div with a header tag near the bottom that issues a request once it is scrolled into view:
<h2>Scroll Down To Load <i class="fa fa-arrow-down" style="margin-bottom:150%"></i> </h2> <h2 ic-src="/get_it" ic-trigger-on="scrolled-into-view"> Not Loaded Yet... </h2>