Home News Forum Articles
  Welcome back Join CF
You are here You are here: Home | Forum | Javascript Gallery Creator


You are currently viewing our boards as a guest which gives you limited access to view most of the discussions, articles and other free features. By joining our Virgin Media community you will have full access to all discussions, be able to view and post threads, communicate privately with other members (PM), respond to polls, upload your own images/photos, and access many other special features. Registration is fast, simple and absolutely free so please join our community today.


Welcome to Cable Forum
Go Back   Cable Forum > Computers & IT > Internet Discussion

Javascript Gallery Creator
Reply
 
Thread Tools
Old 04-11-2004, 22:12   #1
Eric Cartman Wannabe
 
punky's Avatar
 
Join Date: Jun 2003
Location: Cockney geeza land
Age: 27
Services: c:\> net start punky
Posts: 12,086
punky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver bling
punky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver bling
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();
2. Go to a directory with some pics in it.

3. Click the bookmark and it will automatically thumbnail the pictures for browsing.

EDIT: Now fixed, the board kept screwing the JS link up.
__________________
"We're not here for a long time, we're here for a good time" - Mike Ness (Social Distortion)
"Reach for the sky, 'cause tomorrow may never come" - Reach For The Sky (Social Distortion)

Last edited by punky; 04-11-2004 at 22:25.
punky is offline   Reply With Quote
Old 04-11-2004, 22:39   #2
stringy
 
homealone's Avatar
 
Join Date: Jun 2003
Location: Cleethorpes
Age: 55
Services: VM XLplus
Posts: 15,493
homealone has a golden aurahomealone has a golden aura
homealone has a golden aurahomealone has a golden aurahomealone has a golden aurahomealone has a golden aurahomealone has a golden aurahomealone has a golden aurahomealone has a golden aurahomealone has a golden aurahomealone has a golden aurahomealone has a golden aurahomealone has a golden aurahomealone has a golden aurahomealone has a golden aura
Re: Javascript Gallery Creator

hey - it works

oh bouncy one - way to pogo
__________________
Gaz
homealone is offline   Reply With Quote
Old 04-11-2004, 22:41   #3
cf.mega poster
 
Bifta's Avatar
 
Join Date: Jul 2003
Location: Derry
Posts: 7,597
Bifta has a nice shiny starBifta has a nice shiny star
Bifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny star
Re: Javascript Gallery Creator

If only you could resample images with javascript too
Bifta is offline   Reply With Quote
Old 04-11-2004, 22:45   #4
Eric Cartman Wannabe
 
punky's Avatar
 
Join Date: Jun 2003
Location: Cockney geeza land
Age: 27
Services: c:\> net start punky
Posts: 12,086
punky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver bling
punky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver bling
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.
__________________
"We're not here for a long time, we're here for a good time" - Mike Ness (Social Distortion)
"Reach for the sky, 'cause tomorrow may never come" - Reach For The Sky (Social Distortion)
punky is offline   Reply With Quote
Old 04-11-2004, 23:38   #5
cf.mega poster
 
Bifta's Avatar
 
Join Date: Jul 2003
Location: Derry
Posts: 7,597
Bifta has a nice shiny starBifta has a nice shiny star
Bifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny star
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.
Bifta is offline   Reply With Quote
Old 04-11-2004, 23:49   #6
cf.mega poster
 
Join Date: Jun 2003
Age: 29
Posts: 6,273
Richard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze array
Richard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze array
Re: Javascript Gallery Creator

Quote:
Originally Posted by Bifta
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.
I created my own gallery script which I think you nicked code out of before - it's best to experiment really.
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.
Richard M is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT +1. The time now is 11:48.


Links
Google
 
Web www.cableforum.co.uk


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0
Copyright © 2003 - 2008, Cable Forum.
(s204569790.onlinehome.info)