Skip to content

Instantly share code, notes, and snippets.

@bavey
Last active August 29, 2015 14:06
Show Gist options
  • Save bavey/ad3165302ccca7162400 to your computer and use it in GitHub Desktop.
Save bavey/ad3165302ccca7162400 to your computer and use it in GitHub Desktop.
Variant Testing for New Homepage
//
// Optimizely
// Variant Testing for New Homepage
//
//-----------------------------------------------------------------------------
// 1. 3 Circle DM Consult A (Sign Up Beginning)
//-----------------------------------------------------------------------------
// Toggle module
jQuery('.header .mad-libs').hide();
jQuery('.header .static').show();
// Turn off default button
jQuery('.get-started-normal').hide();
// Update urls
jQuery('.find-a-pro .architects a').attr('href', '#!/start-a/step1');
jQuery('.find-a-pro .engineers a').attr('href' , '#!/start-a/step1');
jQuery('.find-a-pro .contractors a').attr('href', '#!/start-a/step1');
//-----------------------------------------------------------------------------
// 2. 3 Circle DM Consult (Sign Up End)
//-----------------------------------------------------------------------------
// Toggle module
jQuery('.header .mad-libs').hide();
jQuery('.header .static').show();
// Turn off default button
jQuery('.get-started-normal').hide();
// Update urls
jQuery('.find-a-pro .architects a').attr('href', '#!/start-b/step1');
jQuery('.find-a-pro .engineers a').attr('href' , '#!/start-b/step1');
jQuery('.find-a-pro .contractors a').attr('href', '#!/start-b/step1');
//-----------------------------------------------------------------------------
// 2. 3 Circle Results Page DM Consult
//-----------------------------------------------------------------------------
// Toggle module
jQuery('.header .mad-libs').hide();
jQuery('.header .static').show();
// Turn off default button
jQuery('.get-started-normal').hide();
// Update urls
jQuery('.find-a-pro .architects a').attr('href', '#!/results/architecture/multifamily/step1');
jQuery('.find-a-pro .engineers a').attr('href', '#!/results/structural-engineers/multifamily/step1');
jQuery('.find-a-pro .contractors a').attr('href', '#!/results/general-contractors/multifamily/step1');
//-----------------------------------------------------------------------------
// 3. Madlibs DM Consult
//-----------------------------------------------------------------------------
// Toggle module
jQuery('.ie8 .header .static').show();
jQuery('.ie9 .header .static').show();
jQuery('.header .static').hide();
jQuery('.header .mad-libs').show();
// Turn off default button
jQuery('.get-started-normal').hide();
// Display appropriate button
jQuery('button.get-started-results-dmconsult').hide();
jQuery('button.get-started-step1').css({'display': 'block'});
//-----------------------------------------------------------------------------
// 4. Madlibs Results Consult Form
//-----------------------------------------------------------------------------
// Toggle module
jQuery('.ie8 .header .static').show();
jQuery('.ie9 .header .static').show();
jQuery('.header .static').hide();
jQuery('.header .mad-libs').show();
// Turn off default button
jQuery('.get-started-normal').hide();
// Display appropriate button
jQuery('button.get-started-step1').hide();
jQuery('button.get-started-results-dmconsult').css({'display': 'block'});
@bavey
Copy link
Author

bavey commented Sep 17, 2014

Added a default button which is turned on by default in the CSS so I have jQuery turning it off. In case the experiment is deactivated, the default button will work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment