I have a page where a user has to drag items from an area elsewhere on a screen.
When all items are dragged out — 100% task is accomplished.
I would like to calculate what % of the task is accomplished on each drag and drop (when an items is dragged out of gray area).
How do I count remaining items within an area?
How do I convert into percentages?
Shall I calculate what each item’s worth in terms of % on page load and then subtract?
Based on Chris May’s comment, try this :
Here it starts since the first drop from 0% to 100%
Fiddle here: http://jsfiddle.net/qQdZy/
EDIT :
This should fix the problem 🙂
New fiddle : http://jsfiddle.net/qQdZy/1/
NEW EDIT :
Ok, I have changed my solution. Here it works :
Fiddle : http://jsfiddle.net/qQdZy/3/