Covid19stats.js is a jQuery plugin to create a coronavirus (COVID-19, SARS-CoV-2) statistics widget that fetches data from coronavirus-tracker-api and displays confirmed cases, deaths, and recovered patients by country.
1 Load the covid19.css
for the basic styling of the widget.
<link href="dist/css/covid19.css" rel="stylesheet" />
<div id="covid-widget"></div>
covid19stats.js
after loading jQuery library.<script src="/path/to/cdn/jquery.min.js"></script>
<script src="/path/to/dist/js/covid19stats.js"></script>
$.covid19stats({
element: "#covid-widget",
countryCode: "IT"
});
5 Determine whether to show confirmed cases, deaths, and recovered patients. Default: true.
$.covid19stats({
element: "#covid-widget",
countryCode: "IT",
showCases: true,
showDeaths: false,
showRecovered: true
});
$.covid19stats({
element: "#covid-widget",
countryCode: "IT",
showImg: false
});
$.covid19stats({
element: "#covid-widget",
countryCode: "IT",
showRightLabel: false
});
Author: ExpDev07
Live Demo: https://coronavirus-tracker-api.herokuapp.com/
GitHub: https://github.com/ExpDev07/coronavirus-tracker-api
#coronavirus #javascript #jquery #covid-19