Search code examples
javascriptzurb-foundationzurb-foundation-6

How can I use tooltip with Foundation 6?


I'm loading jquery.js and foundation.min.js on my page.

I read the documentation for tooltip. There, it is written that I need

  1. foundation.util.box.js
  2. foundation.util.mediaQuery.js
  3. foundation.util.triggers.js

for the tooltip, but I didn't find a download link for these files under foundation.zurb.com. After some research, I found these files athttps://cdnjs.com/libraries/foundation. I loaded the required libraries, but the tooltip still does not work for me.

How can I use a tooltip under foundation 6?


Solution

  • To initialize Foundation, you do not only need to import the scripts, but you also need to bootstrap your foundation elements by placing $(document).foundation(); in your JavaScript or whenever you have created your DOM.

    You could also place it between <script> tags in the bottom of your <body>