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.

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

Thanks

Hi Ashley,

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

Regards

1 Like

Hi,

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?

Thanks,

Rolf

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;
else
  direction = AP.EffectDirection.RIGHT;

// show next slide with custom transition
prez.nextSlide({
    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)

Regards

Thanks, Toan, excellent!