I have a set of 4 images, each with its own unique information that I want to display in a pop-up box. To achieve this, I've opted to use Bootstrap due to its responsiveness and reliability for such tasks.
My main concern is avoiding the repetition of code when setting up the modal boxes. For example, having to copy and paste the same lines of code like:
$("#smiley").click(function () {
$('#myModal').modal('show');
});
And repeating this process for 200 images can be quite tedious.
Check out an example here, where you can click on an image to reveal the modal box.
A couple of questions that arise from this setup include:
- Why is the dialog box not appearing as expected?
- Is it feasible to condense a full HTML page into a more compact format rather than having lengthy sections of information?