Transitions via JS?

Hi there,

Is it possible to use JS to change a Transition effect based on the option a user selects? I’d like to use this change the transition based on whether the user selects the forward or back button.

Click next and slide Transitions using push from right
Click Back and slide Transitions using push from left


Hi Ashley,

We’ll support it in version 8 which is going to be released this month.


1 Like


is this now a feature in version 8?

I would like something similar. Can I change the kind of transition in JS depending on a variable in my project?



Hi Rolf,

Yes, it’s now a JavaScript API in version 8.
For example:

// set transition option based on a variable
var direction;
if (prez.variable('direction') == 'left')
  direction = AP.EffectDirection.LEFT;
  direction = AP.EffectDirection.RIGHT;

// show next slide with custom transition
    transition: AP.TransitionType.PUSH,
    duration: 500,
    direction: direction

For more information, please refer to showSlideAt(index, options) API in the user manual. (page 253, Custom JavaScript in HTML5 Output section, UM version 8)


Thanks, Toan, excellent!