function bubbleHover() { for (var e = document.querySelectorAll('circle'), t = 0; t < e.length; t++) { e[t].addEventListener('mouseover', function () { fillColor(this) }) } } function fillColor(e) { e.setAttribute('style', 'fill:' + colors[Math.floor(Math.random() * colors.length)]) }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter