I have a set of picture ads that I want to change the order of every day at midnight.
Basically so that one day it will be like this
<img src="image1">
<img src="image2">
<img src="image3">
<img src="image4">
and the next day it will look like this
<img src="image4">
<img src="image1">
<img src="image2">
<img src="image3">
How could I accomplish this with javascript, jquery or php. Not concerned about what language I use, just need to figure it out. Thanks..
You can change the order of photos in a photo dump to create an entirely new look. Instagram unveiled the option to edit a carousel of multiple images back in November 2021. Not only can you delete photos from a photo dump, but you can also rearrange your photo album by deleting and re-adding images to it.
To perform other actions, click the three-dot icon in the upper right and select Edit Album. You can now rearrange photos by dragging and dropping them to new positions, remove a photo by clicking its X mark, and change the name of the album.
Try this one http://jsfiddle.net/KQwf2/1/
HTML:
<img src="http://solarpanels2green.com/images/one.gif" title='1'>
<img src="http://solarpanels2green.com/images/two.gif" title='2'>
<img src="http://solarpanels2green.com/images/three.gif" title='3'>
<img src="http://solarpanels2green.com/images/four.gif" title='4'>
and js code
var all = $('img'),
shift = Math.floor(
(new Date().getTime() - new Date().getTimezoneOffset() * 60000)
/ (24 * 3600 * 1000)) % all.length;
all.filter(':gt(' + (all.length - shift - 1) + ')')
.insertBefore(all.first());
It calculates the MOD of the division of number of days passed since the midnight of January 1, 1970 by the number of the elements in the images list, takes this amount of images from the bottom of the list and moves them in front of the list.
Updated to take into account the timezone of the visitor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With