A
A
Anton Essential2016-10-23 01:59:57
JavaScript
Anton Essential, 2016-10-23 01:59:57

How to dynamically push data into img?

Kind, perhaps someone will help.
I don’t know if I came up with all this correctly, and whether it’s possible to do it this way, I came up with it, but I can’t implement it.
I will give an example , probably not very successful but ...
There is a div with two buttons, each button should open the same popup, but the data should be loaded differently, so if I click on button 1, a house is formed in the popup in the slider wrapper, namely div.slide and img with src falls into it , and how to make it so that the house is formed based on the amount of data in the array. if there are 4 addresses per image in the array, there should be four divs and 4 img should fall into them, since there can be not 4 but much more pictures. If you close the popup and click on button2, the same thing should happen, only the data should be loaded by others. Maybe it can be done in some other way.
I can make 2 sliders and set them to display none and then call one of them on click, but that doesn't seem cool.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
iBird Rose, 2016-10-23
@iiiBird

hmm .. why do you need to be so sophisticated if it is much simpler and easier from the side of the backend using ajax?

X
xmoonlight, 2016-10-23
@xmoonlight

src change on the current displayed and several extreme (invisible) objects and everything so that when the animation scrolls, everything is displayed correctly.
For example: 1[2]3456
2 - visible, and 1 and 3 - neighboring invisible - we load them, and the rest - not.
When scrolling in the right direction, we load the rest: we replace the current ruler or add it to the end.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question