javascript - how to delete scene? -
there's code creates scene
function parallaxauto() { var viewer = document.queryselector('.viewer'), frame_count = 6, offset_value = 500; // init controller var controller = new scrollmagic.controller({ globalsceneoptions: { triggerhook: 0, reverse: true } }); // build pinned scene var scene = new scrollmagic.scene({ triggerelement: '#sticky', duration: (frame_count * offset_value) + 'px', reverse: true }) .setpin('#sticky') //.addindicators() .addto(controller); // build step frame scene (var = 1, l = frame_count; <= l; i++) { var scene = new scrollmagic.scene({ triggerelement: '#sticky', offset: * offset_value }) .setclasstoggle(viewer, 'frame' + i) //.addindicators() .addto(controller); } }
i can not figure out how clicking on button delete scene. tried here in ways:
$('.left_arrr').click(function(event) { controller.destroy(reset); controller = null; scene.destroy(reset); scene = null; });
we need in order there still slider of 3 blocks.
according the documentation should pass boolean
value , reset
value got nothing in see!
scene = scene.destroy(true); scene = null; # controller controller.destroy(true); controller = null;
this should use.
also there example on scrollmagic website, check out
Comments
Post a Comment