Skip to content

Instantly share code, notes, and snippets.

@kegster
Created May 4, 2016 14:28
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 kegster/40d1db3f770a2c7825ab80f3d53b5e87 to your computer and use it in GitHub Desktop.
Save kegster/40d1db3f770a2c7825ab80f3d53b5e87 to your computer and use it in GitHub Desktop.
// Move the element off screen
if($('.home_consult_content').length) {
$('.home_consult_content').css('left', '-100%');
}
// When parent visible, move on screen
function inf_control_effects() {
if($('.home_consult_content_wrap').length) {
if($('.home_consult_content_wrap').is_on_screen()) {
$('.home_consult_content').animate({
'left': '0'
}, 900, 'easeOutCubic');
}
}
}
$(window).scroll(inf_control_effects);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment