Reuben
Reuben

Reputation: 2751

Change target from li to a class in jQuery

I currently have this code I've pieced together to accomplish drag and drop divs with drawn lines connecting them.

http://jsfiddle.net/GnY34/

However I don't want to have to use lis at all.. I rather have it attached directly to the divs (class circle).

I'm not sure what I need to change to make that happen? Everything I try breaks it..

Thanks!!!!

Upvotes: 1

Views: 48

Answers (2)

Valentin Rusk
Valentin Rusk

Reputation: 670

You just don't need the inner loop (each).

The source Included the lines that begins it's stroking from the middle of the element. http://jsfiddle.net/GnY34/2/

Upvotes: 1

David Hedlund
David Hedlund

Reputation: 129792

Just update "li" to "div" in your updateCanvas function.

$("div", this).each(function() {

Demo

Upvotes: 1

Related Questions