loktar00 / JQuery-Snowfall

Makes it snow on any web page or specific element.
http://loktar00.github.io/JQuery-Snowfall/
711 stars 221 forks source link

[Conflict] TypeError: Cannot read property 'x' of undefined #5

Closed ghost closed 10 years ago

ghost commented 12 years ago

one page error this bug

Uncaught TypeError: Cannot read property 'x' of undefined b.snowfall.updatesnowfall.min.jquery.js:34 psnowfall.min.jquery.js:57 b.snowfallsnowfall.min.jquery.js:124 (anonymous function)snowfall.min.jquery.js:133 e.extend.eachjquery.pack.js:3 e.fn.e.eachjquery.pack.js:3 b.fn.snowfallsnowfall.min.jquery.js:132 (anonymous function)posting.php:36 f.extend._Deferred.e.resolveWithjquery.pack.js:3 e.extend.readyjquery.pack.js:3 c.addEventListener.C

if (d.collection && this.x > this.target.x && this.x < this.target.width + this.target.x && this.y > this.target.y && this.y < this.target.height + this.target.y) {

pettazz commented 11 years ago

I've got this problem too. Looks like it's related to collection, probably something about the positioning of the collection elements.

loktar00 commented 10 years ago

Hmm not able to reproduce, going to assume its been fixed in the recent version if not will reopen.

davideforgione commented 9 years ago

I'm still having this bug. On row 151 (this.target.x) i have this.target undefined, it's the canvasCollection (this.target = canvasCollection[random(0,canvasCollection.length-1)];) that's empty.

davideforgione commented 9 years ago

Further investigation details: The script is initialized on a master page with a collectonme class for collections. If it's running also on a child page where there's no element to collect on than goes in error.