Skip to content

Instantly share code, notes, and snippets.

@kaynenh
Last active January 10, 2018 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaynenh/af769a21f8d418d8676b834a020bddb7 to your computer and use it in GitHub Desktop.
Save kaynenh/af769a21f8d418d8676b834a020bddb7 to your computer and use it in GitHub Desktop.
Lift Events JS and CSS
//CSS, needs to be replaced with the appropriate selectors
.block-content__hero {
opacity: 0;
-webkit-transition: opacity 300ms;
}
//JS
(function() {
window.addEventListener('acquiaLiftContentAvailable', function(e) {
console.log('acquiaLiftContentAvailable event occurred. This indicates a rule is published and is the last event in the personalization rendering.');
console.log(e);
jQuery('*[data-lift-slot="' + e.detail.decision_slot_id + '"]').css('opacity','1');
});
window.addEventListener('acquiaLiftStageCollection', function(e) {
console.log('acquiaLiftStageCollection event occurred. This is the end of the Lift lifecycle and should occur whether rules are published or not.');
console.log(e);
jQuery('*[data-lift-slot]').css('opacity','1');
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment