jmpressjs / jmpress.js

A jQuery plugin to build a website on the infinite canvas
http://jmpressjs.github.com/jmpress.js
1.5k stars 237 forks source link

How to prevent looping? #119

Closed jetlej closed 11 years ago

jetlej commented 11 years ago

I'd like the demo to deinitialize after reaching the final step. I don't see an option for this, and I get a recursion loop if I try to 'deinit' using 'leaveStep' attached to the last step.

sokra commented 11 years ago

I think you can workaround this with the following code: (but it's not tested)

$(...).bind("leaveStep", function() {
  setTimeout(function() { $(...).jmpress("deinit"); }, 0);
});
jetlej commented 11 years ago

Worked perfectly, thanks again!