Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a method to get the current value of progress bar #538

Closed
danula opened this issue Jun 10, 2018 · 1 comment
Closed

Add a method to get the current value of progress bar #538

danula opened this issue Jun 10, 2018 · 1 comment
Milestone

Comments

@danula
Copy link

danula commented Jun 10, 2018

While it is possible to manually set the value to progress bar. If you need to increment the value, you need to do the following.

var progress_bar_width = $('#jspsych-progressbar-inner')[0].style.width.slice(0,-1);
jsPsych.setProgressBar(progress_bar_width*0.01+0.02);

It would be convenient for users if there is a method that returns the current value of progress bar.

@jodeleeuw
Copy link
Member

Agreed.

If you haven't manually altered the progress bar you can get the current value like this:

jsPsych.progress().percent_complete

@jodeleeuw jodeleeuw added this to the 6.1 milestone Jun 15, 2018
jodeleeuw added a commit that referenced this issue Oct 9, 2018
jodeleeuw added a commit that referenced this issue Oct 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants