简体   繁体   中英

How to reverse the order of the image gallery in FancyBox?

I'm editing a website that uses Fancybox as it's main photo gallery.

I was asked to add photos which I did by adding the photos to the main and thumbnail folders.

They show up fine except they show up at the bottom of the page after all the other pictures. I want new photos uploaded to show up on top first so they are more visible.

Basically reverse the order of all the photos. I've never used Fancybox so I'm just curious if this is easily possible Looked around but couldn't find much. Thanks.

Reverse the order of the list that you use to create the gallery. For instance you might have something that looks like:

<img src="./img1.jpg/>
<img src="./img2.jpg/>
<img src="./img3.jpg/>
<img src="./img4.jpg/>

Do this instead:

<img src="./img4.jpg/>
<img src="./img3.jpg/>
<img src="./img2.jpg/>
<img src="./img1.jpg/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM