playToLabel complete function

CSS styling, controls, custom look and feel, custom packaging and deployment.
dreidesign
Posts: 11
Joined: Fri Sep 21, 2018 2:48 am
Contact:

playToLabel complete function

Postby dreidesign » Thu Jan 24, 2019 8:29 am

Hello,
I was wondering if there is the possibility to call the complete function also when the playToLabel is currently on the right position.

I registered some click events with the "playToLabel". When the "playToLabel" has finished I want to fadein a div.
This is however working, but not in all cases.

Example:
I got 4 buttons:
-button 1 plays to label "frame01" and fades in "highlight01"
-button 2 plays to label "frame02" and fades in "highlight02" ---> From 1 to 2 this works
-button 3 plays to label "frame01" and fades in "highlight02" ---> when I click this button after I clicked button 1 nothing happends, because playToLabel never completes
-button 4 plays to label "frame02" and fades in "highlight04"

This is a simplified version of what I'm using

Code: Select all

api.images.playToLabel("frame01", 2, function(){
$('.highlight01').fadeIn();
}
);


Any ideas how I can fix this?

WebSupport
Posts: 943
Joined: Thu Aug 23, 2012 11:35 am
Location: Pasadena, CA
Contact:

Re: playToLabel complete function

Postby WebSupport » Fri Jan 25, 2019 11:02 am

I see, hmmm.. For now I suggest to call api.images.getCurrentImageIndex() before calling playToLabel and compare it with the "playTo" index you need which should be pretty simple?

dreidesign
Posts: 11
Joined: Fri Sep 21, 2018 2:48 am
Contact:

Re: playToLabel complete function

Postby dreidesign » Tue Jan 29, 2019 12:40 am

How can I get the "playTo" index? Have looked into the documentation but haven't found it.

WebSupport
Posts: 943
Joined: Thu Aug 23, 2012 11:35 am
Location: Pasadena, CA
Contact:

Re: playToLabel complete function

Postby WebSupport » Tue Jan 29, 2019 7:47 pm

Right.. :) I assumed you would know the index upfront but I saw your example in the email today and it's pretty involved (great job!) so I guess we will have to fix playToLabel as per your comment as knowing the indexes upfront is not feasible in your app exactly! Will follow up via email.


Return to “Viewer Development and Customizations”