Skip to content
the poor coder

multiple magnific popup

Poor Man
Published
Reading time
1 min read
Text
<div class="magnific-popup">
  <!-- Your content here -->
</div>

<script>
  $('.magnific-popup').magnificPopup({
    type: 'image',
    items: {
      src: 'path-to-image.jpg'
    },
    gallery: {
      enabled: true
    },
  });
</script>

If you need to create multiple magnific popup elements in your HTML page, you can use the jQuery plugin magnificPopup. This plugin will allow you to create a gallery of multiple magnific popup elements. To do this, you will need to add a div element with a class of "magnific-popup". You will also need to add a script tag to your HTML page which will call the magnificPopup plugin. The code for the script tag will look like this:

Text
$('.magnific-popup').magnificPopup({
    type: 'image',
    items: {
      src: 'path-to-image.jpg'
    },
    gallery: {
      enabled: true
    },
  });

The .magnific-popup class will target the div element that contains your magnific popup elements. The type property specifies what type of content will be displayed in the popup. The image option will open an image in the popup. The items property will be an object that contains the source of the image. The gallery property will be an object that contains the option to enable a group of items to be displayed in the popup. Once the script tag is added, you can add additional div elements with the same class of "magnific-popup" and the plugin will add each of them to the same popup. This will allow you to create multiple magnific popup elements and have them all open at the same time.

Keep going

2023

how to sort an array

How to Sort an Array If you have an array and you want to order its elements in a specific way, you need to use a sorting algorithm. There are several sorting algorithms available, but two of the most commonly used are…

javascript2 min read
2023

jquery mobile or desktop

jQuery Mobile or Desktop? As a web developer, I have had some experience with both jQuery Mobile and jQuery Desktop. Both frameworks have their pros and cons, and which one to use really depends on the specific project…

javascript1 min read
2023

node.js folder structure

Node.js Folder Structure If you are new to Node.js, it can be daunting to create a folder structure that will work for your project. The structure you choose will depend on the size and complexity of your project. Here…

javascript1 min read
ESC