Answer the question
In order to leave comments, you need to log in
Lightgallery dynamic. Adding an alt attribute?
I am generating a lightgallery with the following dynamic script. Everything works as it should.
defer(function () {
$(document).ready(function () {
$("#lightgallery").on('click', function () {
$(this).lightGallery({
dynamic: true,
dynamicEl: [
@foreach (var photo in Model.Photos)
{
@:{"src": '@Url.Action("GetPhoto", "Photo", new { photoId = photo.Id, photoName = photo.Name })', 'thumb': '@Url.Action("GetPhotoThumbnail", "Photo", new { photoId = photo.Id, photoName = photo.Name })' },
}
]
});
})}
)});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question