![]() |
Javascript Gallery Creator
I stumbled across this, it is great and should be of use to someone else. It takes a directory listing of pictures, and automatically makes a gallery out of them. I have tried it in IE and FireFox and it works.
Instructions: 1. Save the following code as a bookmark. (If you are using IE, add any page as a bookmark, then right click on the bookmark in Favourites, and then goto properties, and manually change the link. Click accept if it gives you a warning). Code:
javascript:var sHTML='<html><head><title>gallery</title><body><center><table border=0>';var y=0;links=document.getElementsByTagName(%22a%22); for(x=0;x<links.length;x++){a=links[x].href; if (a.match(/jpeg|jpg/i)){sHTML+='<td style=%22border-style:solid;border-width:1px%22><a target=%22_new%22 href=%22'+a+'%22><img border=%220%22 width=%22100%22 src=%22'+a+'%22></a></td>'; if (!((x+1)%5)) sHTML+='</tr><tr>'}};document.body.innerHTML=sHTML+'</table></center></body></html>';document.close();3. Click the bookmark and it will automatically thumbnail the pictures for browsing. EDIT: Now fixed, the board kept screwing the JS link up. |
Re: Javascript Gallery Creator
hey - it works :)
:nworthy: oh bouncy one - way to pogo :) |
Re: Javascript Gallery Creator
If only you could resample images with javascript too :(
|
Re: Javascript Gallery Creator
Yeah it is a shame PHP isn't interactive where you could.
I probably could do it, by hosting a PHP doc, which takes a url as a value, and does it. This is fairly quick and easy though. |
Re: Javascript Gallery Creator
Ah I've got PHP scripts that do exactly the same, someone posted one on their blog (elsewhere), admittedly it was a little bit more than one line of code, but you still only had to upload a single document into the folder with the images in. Very handy.
|
Re: Javascript Gallery Creator
Quote:
I rarely use Javascript these days because PHP is so much more powerful, especially in cases like this. BTW Punky - you could make that code standards compliant if you wanted to. ;) |
THAT IS QUITE AWESOME!!!!!!
I can find alot of uses for something like this :) |
Re: Javascript Gallery Creator
WOW Dude you sure dig deep. :)
|
| All times are GMT +1. The time now is 00:44. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum