Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Is it possible to move slides dynamically? #373

Open
joefarebrother opened this Issue · 5 comments

3 participants

@joefarebrother

So is it possible to alter the data-x, data-y, data-z, data-rotate, data-scale, etc, with JS during the course of the presentation to move the slides? Also is it possible to add and remove slides dynamically?

@bartaz
Owner

Unfortunately not.

Slides information is read when presentation is initialised (with impress().init()) and it can't be changed later.

So in theory it is possible to alter data- params or add slides with JS, but only before presentation is initialised and started. After that they cannot be changed.

@joefarebrother
@edwardoyarzun

By default you can't do that with Impress.js, so I've added a new entry to the Impress.js API where you can do that.
Take a look at Dyapos, my new Prezi-like tool for Impress.js: https://github.com/edwardoyarzun/dyapos
And look at this file at line 638: https://github.com/edwardoyarzun/dyapos/blob/master/django_app/project/static/js/editor/impress_custom.js
I exported the function "initStep()".
Then If you call impress().initStep(document.getElementById("my-step-id")); you can recompute that slide with Javascript. That's the solution to your problem.
I made a pull request a time ago with that feature but @bartaz didn't merged it :(

@joefarebrother
@edwardoyarzun

Yes, you only have to add that line. Later, when you modify the data properties of a .step like data-rotate data-x data-y, you only have to call impress().initStep(document.getElementById("my-step-id")); or impress().initStep($("#my-step-id")) in case you're using Javascript.

@bartaz bartaz referenced this issue
Open

Reload "data" #407

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.