A tiny (~750 bytes when minified and gzipped) function written in pure javascript (no jQuery or other dependencies) which draws basic guitar chord diagrams in HTML/CSS. Accepts an array of fret positions (mandatory) and an array of finger numbers (optional). Automatically detects barre if more than one string is picked on the same fret with the same finger.
Download a JS file (minified, gzipped) and a CSS stylesheet (minified, gzipped), drop them onto your page. To create a div
containing DOM structure for C chord call:
var diagram = chordDiagram([-1,3,2,0,1,0], [-1,3,2,-1,1,-1]);
Then to attach it to your document, call:
document.body.appendChild(diagram);
Above will produce something like this:
You sort of can work it out from the above example, but I will describe it here at some point.
Doesn't apply. Use it as you wish, but be aware that it may explode and blow your head off or something, so don't come back to me if that happens blah blah blah.