Johann-S/bs-breakpoints

Usage with jQuery

flatcapco opened this issue · 3 comments

Hey thanks for the plugin - this looks great but I'm struggling to use it properly with jQuery

I can see the breakpoint if I query it like so:
console.log($.Event(bsBreakpoints.getCurrentBreakpoint()).type);

but reading your documentation I believe I should be able to access the breakpoint type on change by default? Could you please provide an example of the following:

"when breakpoint type changes fire XXX"

I could put it within a wrapper like: $(window).on('load resize scroll', function () { }
But I believe this has already been taken care of so not the correct way to handle it?

Hi @latwelve,

Thanks for using my plugin, you'll find an example here: https://github.com/Johann-S/bs-breakpoints/blob/master/tests/index-jquery.html#L20-L35

If you any further questions do not hesitate 😉

I have a problem with usage bs-breakpoints with old jQuery (1.6.2). For test I changed your code:

  var getJQuery = function getJQuery() {
    return null; // removed return window.jQuery
  };

..and then it works!

How can I fix it better? I do not want to change bs-breakpoints source code.

Hi @cichy380 I can't help you with just 3 lines of your code.
BTW you should think about upgrading your jQuery because you expose your website to security issue.

I'll close this issue because I answered the first question