[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.javascript

scripting progress bar

pentapus

10/13/2014 7:07:00 PM

I'd like to script a UI for the audio element using the progress bar.

What does it take to return a value of where on a progress bar you
click, such that clicking midway would return 50%, which could then be
used for setting the play point in the track?

--
pentapus
2 Answers

Frances

2/18/2014 1:50:00 PM

0

On Wednesday, 12 February 2014 19:16:21 UTC, Michelle Steiner wrote:
> > What is the minimum percentage that you would consider a good session? > >

As others have said, it depends on the event and the club.

I'm also not sure it's really relevant what absolute number I aim at. I know what I average at my local club, and I would say a good session is 5% or more above that.

If you play regularly, the thing to look for is a slow but sure increase over time, which implies you are improving, although there will be a lot of variability.

baileyrockwodd

10/13/2014 7:51:00 PM

0

On 10/13/2014 03:07 PM, pentapus wrote:
> I'd like to script a UI for the audio element using the progress bar.
>
> What does it take to return a value of where on a progress bar you
> click, such that clicking midway would return 50%, which could then be
> used for setting the play point in the track?
>

You're using the wrong element. If you just want to show the user an element, use a <progress /> element. If you want the user to be able to change the value of an element, like an audio scrubber, use a <input type="range" /> element.

To give you an example of an audio UI here's the shadow DOM for chrome's <audio controls /> element (excuse the poor formatting):

<div><div><div>
<input type="button">
<input type="range" step="any" max="307.566">
<div style="">0:01</div><div style="display: none;">5:07</div>
<input type="button">
<input type="range" step="any" max="1" style="">
<input type="button" style="display: none;">
<input type="button" style="display: none;">
</div></div></div>

To get set the value:

parseInt(document.querySelector("input[type=range]").value);

To set the value:

document.querySelector("input[type=range]").value=50;