Last active
January 4, 2016 22:08
-
-
Save commuterjoy/8685338 to your computer and use it in GitHub Desktop.
Previewing interactives on theguardian.com
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
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(); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice, worked for me, ta!