简体   繁体   中英

Ionic Slide Time Counting

I am developing a mobile application with ionic and angular. And also I used ionic slides for it. User can read the things that I included in the slides. Now I want to estimate the time it takes for the user to read the slides one by one. This table shows the final output that I want.

Slide Number the time it took the user to read the slide
1 10s
2 4s
3 5s
1 12s ( 10s + 2s )

When the user reads the previously read slide again, the time should be added to the previous reading time.

Can someone help to implement this or send me a related reference for this?

What steps have you taken to try and implement this yourself? And if you did take some steps, what results/errors did you get?

If you're assuming that the slide has been read once the user slides to the next, then you can capture the time in milliseconds (A1) as soon as the first slide is displayed in view, then subtract that from the time (B1) at which the next one is loaded (B1-A1) [use some of the events on https://ionicframework.com/docs/api/slides to watch for the slide change], then store it in your var (C1, C2, etc.) - for example: C1 as slide1readingTime, C2 as slide2readingTime etc. and increase that value by (Bn-An) each time the same slide has been swiped (Cn += (Bn-An) ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM