Answer the question
In order to leave comments, you need to log in
Which placeholder site can randomize pictures?
Guys, how to make one page have different placeholder pictures?
like you insert a picture of the format
https://source.unsplash.com/300x200
lorempixel.com/300/200
loremflicker.com/300/200
placekitten.com/300/200
into the layout of the news page,
but it does not give the same picture , but everyone is different
Answer the question
In order to leave comments, you need to log in
lorempixel.com can serve 10 different images from the same category:
http://lorempixel.com/400/200/sports/1
http://lorempixel.com/400/200/sports/2
...
http://lorempixel.com/400/200/sports/10
In short, I made it so that different pictures in the layout were shown on the same link
in my case, the picture is displayed ten to twenty times like this:
Recipe - I attach the "nocache" class to the pictures
and in the basement
$(document).ready(function (){$('.nocache').attr('src',function () { return $(this).attr('src') + "?" + Math.random() });});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question