Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iZiModal not working with Webpack! #213

Open
tr1s opened this issue Oct 9, 2018 · 0 comments
Open

iZiModal not working with Webpack! #213

tr1s opened this issue Oct 9, 2018 · 0 comments

Comments

@tr1s
Copy link

tr1s commented Oct 9, 2018

I tried a method I saw in closed issues, but it didn't fully work. Can someone help me solve this please?

I tried using the method where you do $.fn.iziModal = iziModal; and it half worked.

screenshot 2018-10-09 12 01 42

The error went from iziModal not being a function, to iziModal not being defined. But everything works if I just use a CDN, so I know my js works. What am I doing wrong?

This is my js

$(function () {
  $.fn.iziModal = iziModal;

  $("#modal").iziModal({
    title: 'Test',
    subtitle: 'Test',
    headerColor: '#233a79'
  });

  $(document).on('click', '.trigger', function (event) {
    event.preventDefault();
    $('#modal').iziModal('open');
  });

Where am I supposed to put $.fn.iziModal = iziModal;? I tried putting it in the iziModal.min.js, the top of my custom scripts, inside my jQuery document (like the code above), and where I have all my imports, none of these places seem to work. Yes I am importing the iziModal.min.js and css.

Any help would be greatly appreciated thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant