Instantly share code, notes, and snippets.

Embed
What would you like to do?
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