Skip to content

Instantly share code, notes, and snippets.

@thomasrstegelmann
Created December 16, 2015 12:29
Show Gist options
  • Save thomasrstegelmann/31175c6175ac85b12a89 to your computer and use it in GitHub Desktop.
Save thomasrstegelmann/31175c6175ac85b12a89 to your computer and use it in GitHub Desktop.
To avoid flickering when you try hiding elements with Optimizely, inject css styleheads into the head element instead of using Javasript to apply css to each element.
/* _optimizely_evaluate=force */
$('head').append('<style type="text/css">.something {display:none !important;}</style>');
/* _optimizely_evaluate=safe */
$('head').append('<style type="text/css">.something {display:none !important;}</style>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment