Skip to content

Instantly share code, notes, and snippets.

@mhayes
Last active December 20, 2015 13:48
Show Gist options
  • Save mhayes/6141151 to your computer and use it in GitHub Desktop.
Save mhayes/6141151 to your computer and use it in GitHub Desktop.
Using jQuery noConflict mode

Enabling noConflict mode

Using a default Foundation 5 download you'll see some code like this in your index.html file:

<script src="bower_components/jquery/jquery.js"></script>
<script src="bower_components/foundation/js/foundation.min.js"></script>
<script src="js/app.js"></script>

In the included app.js you'll see:

$(document).foundation();

You'll want to enable noConflict by replacing that code with this:

jQuery.noConflict();
jQuery(document).foundation();

That's it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment