Copy link to clipboard
Copied
I'm looking for code to load many images to html from local folder...thanks
I'm doing it with PHP code and the latest Fancybox which is a very nice modal viewer.
Alt-Web Demo : Dynamic Photo Gallery with Bootstrap, PHP & Fancybox
I should also mention that Fancybox supports the image srcset. I didn't use it in this demo mainly because I don't have small medium and large images yet. But when I do, I will add it to the code.
Fancybox documentation is well-worth reading too because there's a lot more you can do with it.
fancyBox - touch enabled, responsive and fully customizable lightbox script
...Copy link to clipboard
Copied
what do you nean... could you send us more details...?
is it an AJAX function ? a gallery ? looking in a folder ? loading from a list JSON? XML?
do you want to upload the files to the server... using drag and drop ?
Copy link to clipboard
Copied
Thanks for all your responses to my issue. To further explain, I'm making a css grid of 25 plus images. i have a modal I'm using in the code; that uses clicks to open and close each image. it works when using one image file. I'm proceeding to code in modal scripts for each image by making unique variables on the scripts; because I'm having problems with the click to close not working from modal script when I have more than one image. All images are local. It seems using a script to load into an array to serve modal from image folder is better than using modals for each image.. Perhaps there is a better approach to this plan. I plan to upload to host when website is done. All suggestions are greatly appreciated.
Copy link to clipboard
Copied
Have a look at this answer javascript - How to use bootstrap modal on multiple images on same page on image click? - Stack Over...
Copy link to clipboard
Copied
I'm doing it with PHP code and the latest Fancybox which is a very nice modal viewer.
Alt-Web Demo : Dynamic Photo Gallery with Bootstrap, PHP & Fancybox
I should also mention that Fancybox supports the image srcset. I didn't use it in this demo mainly because I don't have small medium and large images yet. But when I do, I will add it to the code.
Fancybox documentation is well-worth reading too because there's a lot more you can do with it.
fancyBox - touch enabled, responsive and fully customizable lightbox script
Nancy
Copy link to clipboard
Copied
Like Birnou said, we need more info about your requirement
- What is it that you are trying to do?
- How are you doing it?
- What is the expected result?
Thanks,
Preran
Copy link to clipboard
Copied
jamieh2os wrote
I'm looking for code to load many images to html from local folder...thanks
You could this dynamically on the server with PHP scripts.
Copy link to clipboard
Copied
I'm most thinking on client side, not server side, using file API...
https://www.html5rocks.com/en/tutorials/file/dndfiles/
https://scotch.io/tutorials/use-the-html5-file-api-to-work-with-files-locally-in-the-browser
Copy link to clipboard
Copied
If you're building a client-side application like an image editor, sure. But for routine things like a web site photo gallery, PHP code takes care of it automatically when you add or delete images from the folder.
Copy link to clipboard
Copied
the OT talks about a local folder... so I thought that it was on the OT machine... not on a remote one ? Sorry I miss understood