C
C
christi1572019-03-17 18:58:19
JavaScript
christi157, 2019-03-17 18:58:19

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 })' },
                                }
                                ]                              
                            });                                                 
                        })}
                    )});

Now I need to add an alt attribute to each photo. in the core of lightgallery, there probably isn't one. how to do it? Thank you very much in advance!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question