Skip to content

Responsive

swirtSJW edited this page Nov 21, 2013 · 4 revisions

This is where the real power of TemplatIt comes into play. On responsive sites, any template can be tossed anywhere on the page on a per screen state basis.

[THIS PAGE IS INCOMPLETE ...very INCOMPLETE]

Responsive Triggers

preStateChange - this event is triggered the instant BEFORE the screenstate changes and old templates are eaten and new templates are tossed. The values for oldstate and newstate are passed to the bind. example of how to make bind an event to run

    //Set event to happen when preStateChange is triggered
    $(document).on( "preStateChange", function() {
      // Do something that you want to run just before the state changes.
    });

postStateChange - this event is triggered the instant AFTER the screenstate changes and new templates are tossed. The values for oldstate and newstate are passed to the bind. example of how to make bind an event to run

    //Set event to happen when postStateChange is triggered
    $(document).on( "postStateChange", function() {
      // Do something that you want to run just after the state changes.
    });

templatitInitialized - this event is triggered only once as Templatit is initialzed. It is mainly for internal use by Templatit.

Clone this wiki locally