zuck.js icon indicating copy to clipboard operation
zuck.js copied to clipboard

Multiple instances in one page.

Open ChathuraGH opened this issue 1 year ago • 11 comments

Normally you can't use 2+ zuck.js instance in one page, because zuck.js use same id to get model div. This can be fixed by following.

  1. give "zuck_model_perfix" in options
  2. use this prefix to make unique ids
  3. use only html classes to style elements in css 😜👈👌😉

ChathuraGH avatar Sep 24 '23 21:09 ChathuraGH

Normally you can't use 2 zuck.js instance in one page, because zuck.js use same id to get model div. This can be fixed by following.

  1. give "zuck_model_perfix" in options
  2. use this prefix to make unique ids
  3. use only html classes to style elements in css 😜👈👌😉

Hallow please how do i add the perfix in options?

franklin-hub avatar Oct 14 '23 09:10 franklin-hub

I have modified the original library and it works. If you, anyone need, I can upload it.👍.

ChathuraGH avatar Nov 25 '23 15:11 ChathuraGH

@ChathuraGH would you mind to create a pull request?

ramonszo avatar Nov 26 '23 23:11 ramonszo

Ok @ramonszo . I will create a pull request 👍.

ChathuraGH avatar Nov 27 '23 02:11 ChathuraGH

@ramonszo I created a pull request 😊. I am new to pull requests. So if there is any inconvenience, help me.💪.

ChathuraGH avatar Nov 28 '23 17:11 ChathuraGH

@ramonszo procedure is as follows.

  1. use "modalContainer.classList.add('zuck-modal');" to add class to the modal > in zuck.js file

  2. use this class to add css to modal element and child elements > in zuck.css file

  3. Let user define option 'ZuckModal_perfix' > in html file

This perfix must me unique for every instance in the page.

  1. use this variable to create and access modal element and it's child elements > in zuck.js file

ChathuraGH avatar Nov 28 '23 18:11 ChathuraGH

What is going on @ramonszo .. 👀👀 I created the pull request. If you can marge it or why it is not been? 🙏🙏. Tell me what is the problem; or you want working example or explanation. I just want to help. 🤗🤗.

ChathuraGH avatar Dec 15 '23 13:12 ChathuraGH

@franklin-hub

Hallow please how do i add the perfix in options?

Did you get it to work?

ChathuraGH avatar Dec 19 '23 13:12 ChathuraGH

@ramonszo, what is the problem here friend?

ChathuraGH avatar Dec 19 '23 13:12 ChathuraGH

Hello 👈👈?

ChathuraGH avatar Jan 16 '24 09:01 ChathuraGH

Hey @ChathuraGH I made a comment on your PR, thanks for the contribution

ramonszo avatar Jan 17 '24 02:01 ramonszo