qrohlf / trianglify

Algorithmically generated triangle art
http://qrohlf.com/trianglify/
GNU General Public License v3.0
10.08k stars 669 forks source link

jQuery #46

Closed adrianoresende closed 9 years ago

adrianoresende commented 9 years ago

HTML <canvas id="canvas"></canvas> Javascript pattern.canvas($('#canvas'))

Error: Uncaught TypeError: o.setAttribute is not a function

Why not have support for jQuery?

qrohlf commented 9 years ago

Because Trianglify supports DOM nodes, not jQuery selections (which happen to be arrays, so it wouldn't even make sense to pass that in to a call to pattern.canvas). Try it again with the underlying DOM node (you can get that easily from the jQuery selection).