Как open/enlarge
изображение в модальном режиме, используя jquery/js, а не атрибуты данных?
Каждый раз, когда пользователь вставляет изображение в редактор контента, мне нужно, чтобы оно расширялось в модальном режиме с помощью js, поэтому я не могу рассчитывать на то, что пользователь введет атрибуты данных, которые он не знает, как использовать.
Я старался:-
<a href="/myImage.png" id="pop">
<img src="/myImage.png" style="width: 400px; height: 264px;">
Click to Enlarge
</a>
jQuery :-
$("#pop").on("click", function() {
$(this).modal();
});
Нужно ли добавлять информацию в JQuery, чтобы передать источник изображения, чтобы появиться в модале?
Спасибо!!!