--- layout: default nav: attributes > ic-trigger-on ---

ic-trigger-on - The Trigger On Attribute

Summary

The ic-trigger-on attribute tells Intercooler to load the content of a ic-src attribute when a given event occurs.

This can be used to implement infinite scrolling, lazy loading of elements, etc.

Syntax

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.

Dependencies

ic-target has no effect on dependencies..

Simple Example

Here is a simple button that updates a div on click:

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

Note that the response to the button click is the content to swap in for the div, not the button.

Scroll Down To Load

Not Loaded Yet...