HTML5 Meter Element Progress Bar Tutorial
โœ‚๐Ÿƒ๐Ÿพโ€โ™€๏ธ๐Ÿƒ๐Ÿผโ€โ™‚๏ธ
๐Ÿ“–

HTML5 Meter Element Progress Bar Tutorial

HTML5 Meter Element Progress Bar Tutorial

HTML5 brought with it many great features to front-end work on the internet in HTML, and today, we continue on from yesterdayโ€™s HTML5 Meter Element Primer Tutorial as shown below, we talk about one of the newly introduced, and very useful, elements called โ€œ<meter>โ€. By the way, the โ€œ<meter>โ€ element does not work with mobile Safari, for instance, and you can read more about this here.

As we outlined yesterday, at its core the โ€œ<meter>โ€ element represents a โ€œfraction of oneโ€ or perhaps you can think this as a โ€œpercentage of one hundredโ€, and, as youโ€™d guess, a generic โ€œxth of y for the fraction x/yโ€ idea โ€ฆ where โ€œyโ€ could be your โ€œmaxโ€ parameter, and perhaps your โ€œminโ€ parameter is zero. Today we extend that โ€œfractionโ€ concept to being a โ€œfractionโ€ of completion time, as a progress bar.

Progress bars appear all over the internet. Personally I love the ones that go backwards, just like those mileposts that increase as you head closer to a town. In defense of this occasional progress bar behaviour, it can be quite hard to predict when some jobs will finish โ€ฆ suppose you base it on a file size โ€ฆ but this may not take into account record sizes or intensity of calculation for particular data record types etcetera etcetera etcetera.

With our progress bar today we analyze the pixels of a user-defined image file and show a few of the most commonly occurring pixel colours appearing in that image (file) and present this as a (Google Chart) bar chart, that changes along with the progress bar โ€œprogressingโ€.

So take a look at the PHP code in image_bargraphโšซphp, or a liveโœ‚run, for your perusal. A useful PHP link for this was this one โ€ฆ so, thanks. Hope it helps with a project idea you are mulling over now.

Stop Press: The next tutorial in our sequence called HTML5 Meter Element Word Count Tutorial led to some thinking causing changes to our code above which you can see with the image_bargraphphp link.



Previous relevant HTML5 Meter Element Primer Tutorial is shown below.

HTML5 Meter Element Primer Tutorial

HTML5 Meter Element Primer Tutorial

HTML5 brought with it many great features to front-end work on the internet in HTML, and today we talk about one of the newly introduced, and very useful, elements called โ€œ<meter>โ€.

At its core the โ€œ<meter>โ€ element represents a โ€œfraction of oneโ€ or perhaps you can think this as a โ€œpercentage of one hundredโ€, and, as youโ€™d guess, a generic โ€œxth of y for the fraction x/yโ€ idea โ€ฆ where โ€œyโ€ could be your โ€œmaxโ€ parameter, and perhaps your โ€œminโ€ parameter is zero.

This element is useful to represent a numerical concept graphically (like a ratio), something we do today with โ€ฆ

  • simulation of a stopwatch โ€ฆ with its seconds, minutes, hours, days, years elapsed
  • a fraction as (numerator) x / y (denominator)

Tomorrow weโ€™ll show you a very commonplace usage for โ€œ<meter>โ€ as a โ€œprogress barโ€ which you see so much of on the internet, when you are waiting for something.

So take a look at the HTML code in meterโšซhtml, or a liveโœ‚run, for your perusal. Hope it helps with an HTML project you are on now.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, GUI, Tutorials and tagged , , , , , , , , , , , , , , , . Bookmark the permalink.

25 Responses to HTML5 Meter Element Progress Bar Tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *