just wondering if anyone could have a look at my code that ive been trying to port to a plugin. There seem to be no errors getting logged, I just cant work out not working (this is my first attempt at a jQuery plugin so I really don't quite know what I'm doing, even though I've done a lot of work with the jQuery library).
Here is the original code (with comments):
http://jsfiddle.net/GZLQH/1/
And this is my attempt and a plugin:
http://jsfiddle.net/PnEYN/
Cheers
Charlie
Here you go: http://jsfiddle.net/aGFdJ/4/
The main point:
this
pointer does not always point to the original element, you need to store a reference to it somewhere.Side notes:
background:url(spark_01.png)
is not going to work in jsFiddle.for(var i = 0; i < sparks.length; i++)
when looping over a array, instead of the for(var key in sparks)
.