pisi / Reel

The premier 360° solution for jQuery.
http://reel360.org
MIT License
690 stars 210 forks source link

$.reel is not a function #305

Open baptistebriel opened 8 years ago

baptistebriel commented 8 years ago

Hello, I'm using reel with npm, browserify and babelify but looks like that doing this:

import reel from '../lib/reel'; // the build file, 'jquery.reel-min.js'

$('#image').reel({
    image: '/image_00000.png',
    cursor: 'move',
    throwable: 10,
    brake: 0.1
});

doesn't work and produce this following error: $.reel is not a function

I have to call reel() to make it work (and it actually breaks 50% of the time, so sometimes it's just not initialised at all...) do you maybe have an idea?

Thanks!

StefanStra commented 7 years ago

Hello,

we exactly got the same problem. did you find a solution?

Thanks

baptistebriel commented 7 years ago

Hi @StefanStra,

Yep, we had to look into source code a bit and found this was working;

const instance = reel({
  frames: frames,
  throwable: 0.1,
  brake: 0.1
})

instance.fn.reel && instance.fn.reel()
instance.scan()

Try adding those two last lines.. hope it helps!

StefanStra commented 7 years ago

I think we've had a problem with loading sequence. it now works but we don't know why :D