javascript - Progress Bar with Added Element -
i have build kind of progress/counter/meter bar in webpage. 
basicly i'll getting data (total number of hours, in case 500h , number of hours avaiable, 400h in example) json , load bar accordingly.
i've tried adapt jqueryui , bootstrap progress bars, i'm getting stuck when implementing circle avaiable hours.
using bootstrap structure
<div class="progress"> <div id="progressbar" class="progress-bar" role="progressbar" aria-valuemin="0"> <span id="pprogress"></span> </div> <div id="circleprogress" class="progress-bar transbar" role="progressbar"> <span id="pcircle"></span> </div> </div> since bootstrap can stack bars, had ideia to, instead of second bar, circle, follow progress bar, since progress div has height, circle gets cut. tried position absolute, got no where.
also tried placing circle on second div, parallel class="progress", couldn't figure out way calculate progressbar position.
so i'm looking tips, solutions or places find solution solve problem.
edit sorry lack of details, made fiddle - http://jsfiddle.net/hmt0l07r/1/
i'm new @ using fiddle, i'm not sure how add image using circle, basicly show top of circle inside light grey bar.
i created rough progressbar on jsfiddle. pretty simple, use date json via ajax , math adding them element. css3 animate whole bar.
var reachedh = 233, totalh = 500, availableh = 400, reachedhpercent = (reachedh / totalh)*100, availablehpercent = (availableh / totalh)*100; $('#pprogress').css({'width':reachedhpercent+'%'}); $('#availableh').css({'left':availablehpercent+'%'}); $('#availableh').text(availableh+'h'); edit: fiddle basic styling , animation. added bar of available hours, saw bubble before. http://jsfiddle.net/5jnn6sqj/1/
Comments
Post a Comment