Skip to content

Instantly share code, notes, and snippets.

@commuterjoy
Last active January 4, 2016 22:08
Show Gist options
  • Save commuterjoy/8685338 to your computer and use it in GitHub Desktop.
Save commuterjoy/8685338 to your computer and use it in GitHub Desktop.
Previewing interactives on theguardian.com
require(['common/modules/interactive/loader', 'common/$'], function (Interactive, $) {
// remove the incumbent interactive
$('.interactive').empty();
// set the data- attribute to a boot module
$('.interactive').attr('data-interactive', 'http://path/to/boot.js');
// initialise the interactive
new Interactive(document.querySelector('figure.interactive'), document, guardian.config).init();
})
@theefer
Copy link

theefer commented Jan 29, 2014

Nice, worked for me, ta!

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