dotjay / hashgrid

A little tool that inserts a layout grid in web pages, allows you to hold it in place, and toggle between displaying it in the foreground or background.
https://dotjay.github.io/hashgrid/
Other
446 stars 46 forks source link

Avoid errors with jQuery used in noConflict mode #15

Closed leonid-shevtsov closed 11 years ago

leonid-shevtsov commented 11 years ago

I found out that hashgrid would not work after jQuery.noConflict() since it's using window.$ instead of window.jQuery.

For example, Wordpress does this this after it's done using jQuery for its own purposes.

I fixed this by redefining $ inside hashgrid() and using jQuery() to initialize the script.

alvarix commented 11 years ago

Leonid,

Can you be more explicit about how you did this for us kiddies? I added

jQuery.noConflict();
(function($) {
  $(function() {
.....
 });
})(jQuery);

inside of hashgrid.js as bookends. I wonder if there is a way to not alter the file itself.

dotjay commented 11 years ago

Only just seen this. Thanks, Leonid. Merging this in.