Made quick popups on jquery, like this:

popupHead = $('<div class="ad__popup-head"></div>') 

There are about 10 such tags, then I put them into each other with the append function and at the end

 $('body').append(popup); 

This is what I quickly came up with. Now I think how to improve this scheme. There are options. 1. Load all the necessary windows at once on the page with all html, but hidden. By clicking show them accordingly. 2. Create these windows in js, as I do now 3. Create a file with this markup, and upload it to the site by clicking.

In principle, option 2 is normal, but it looks as wrong as it seems to me. 3 I think the most correct option, but then you have to turn once more to the north. Tell me how to do better in this case? maybe there is some other option.

  • not easier in a single pop-up to add different information? - Jean-Claude

1 answer 1

IMHO

  • 1 - The best option if the markup is not very complicated (if you need a mold in the popup, a message or a picture)
  • 2 - This option is appropriate only if you have a complex application on the client, otherwise it will cause quite a few troubles, especially for those who will then support the site
  • 3 - This option is best suited if you need to display a lot of information in pop-ups. For example, I somehow did a list of cases and when I clicked on a thumbnail in a popup, detailed info appeared with a gallery, a description of the client’s company, tasks, measures taken, results, similar cases and form. To solve this problem, it would certainly not be very correct to dump all these detailed cases on the page.