0

I want to implement this external JS-plugin, https://github.com/GBKS/Wookmark-jQuery, into my Backbone App. My issue is that I use RequireJS and I really dont know how to get it running. I already asked this before BackboneJS + Require JS + Wookmark.js plugin not working but adding it to my App.js doesnt work at all. So does anyone know what might be the issue here?

The wookmark + imagesloaded plugins both appear in my console, so they get loaded. I tried to run it from a View with no success.

Please help...

1 Answer 1

1

Since wookmark depends on jquery, I would recommend adding it to requirejs shim:

require.config({
  paths: {
    jquery: 'path/to/jquery'
    wookmark: 'path/to/wookmark'
  },

  shim: {
    wookmark: { deps: [ 'jquery' ] }
  }
});

Hope it will solve your problem.

Sign up to request clarification or add additional context in comments.

9 Comments

Do you get any error. Can you see if the $.fn is extended with wookmark?
@chchrist Didn't really get your question but no, I don't get any errors
This plugin registers itself to the $.fn of jquery in order for you to use it like this "$().wookmark" github.com/GBKS/Wookmark-jQuery/blob/master/jquery.wookmark.js (line 485). So console.log($.fn) and check if it exists.
console.log($.fn) tells me that $.fn exists but the plugin is simply not running. I have other plugins defined in my app.js, they run without problems, just this one doesn't work... :s
try console.log($.fn.wookmark) to check if one exist now
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.