Last active
January 10, 2018 16:27
-
-
Save kaynenh/af769a21f8d418d8676b834a020bddb7 to your computer and use it in GitHub Desktop.
Lift Events JS and CSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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