Notices
Non Scooby Related Anything Non-Scooby related

Javascript Question

Thread Tools
 
Search this Thread
 
Old 26 August 2001, 07:40 PM
  #1  
Paul.G
Scooby Regular
Thread Starter
 
Paul.G's Avatar
 
Join Date: Jan 2000
Posts: 164
Likes: 0
Received 0 Likes on 0 Posts
Question

Hello all,
Can anyone tell me why a lot of web pages use Javascript to open thumbnail photos rather that a straightforward HTML link?
On some of the web sites they seem to have used the original image and just set the size smaller for the thumbnail, when I tried this the thumbnail image is distorted. Is it better to use a separate smaller image for the thumbnail? (I was trying to save space by using the original image).

Thanks,
Paul.G
Old 26 August 2001, 09:55 PM
  #2  
sasim
Used to work here!!
 
sasim's Avatar
 
Join Date: Jun 2000
Location: Peterhead, Scotland
Posts: 1,488
Likes: 0
Received 0 Likes on 0 Posts
Cool

I would imagine that they are using javascript so that the images are pre-loaded into the page, so that they appear instantly when clicked or mouse-over.

With normal HTML the image has to be "called" when the user clicks and so takes longer to appear, even though the initial page loads quicker than a javascript one.

Stuart
Old 26 August 2001, 10:08 PM
  #3  
Mr.Cookie
Scooby Regular
 
Mr.Cookie's Avatar
 
Join Date: Apr 2000
Location: www.mrcookie.co.uk
Posts: 5,757
Likes: 0
Received 0 Likes on 0 Posts
Post

Paul

I do thumbnails as there only going to be small files 3-5k and they'll load quicker in the browser, imagine someone trying to load say 10 100k pics on a single page they'll get bored of the wait and go elsewhere.

Si
Old 26 August 2001, 10:11 PM
  #4  
Mr.Cookie
Scooby Regular
 
Mr.Cookie's Avatar
 
Join Date: Apr 2000
Location: www.mrcookie.co.uk
Posts: 5,757
Likes: 0
Received 0 Likes on 0 Posts
Post

ps nice hong kong phoeey and yes i can spot the difference
Old 27 August 2001, 12:34 AM
  #5  
Lee
Scooby Regular
 
Lee's Avatar
 
Join Date: Mar 1999
Location: Essex
Posts: 1,681
Likes: 0
Received 0 Likes on 0 Posts
Post

3 steps to a decent photo gallery with thumbs :-)

1. do NOT use altered width/height tags for the thumbs - the browser still has to download the fullsized image. Convert your large pics to small 150px or less thumbs.

2. Open up the fullsize pic in a browser without the toolbars etc. Makes for a better image.

3. Use a bit of javascript and pass in parameters to avoid code rewrite.
Old 27 August 2001, 10:43 AM
  #6  
Paul.G
Scooby Regular
Thread Starter
 
Paul.G's Avatar
 
Join Date: Jan 2000
Posts: 164
Likes: 0
Received 0 Likes on 0 Posts
Wink

Mr Cookie,
Damn my secrets out all this Subaru stuff is just a cover for sad (I was playing with cute FTP …..Honest ) web pages.
Anyway you mentioned the time to load the page with large images on, would using the Width and height attribute on the page with the IMG tag to reduce the size of the image not help to load the page quicker?
Or does it still have to load the full size image even though the one displayed is smaller? (If that makes any sense).

Yours (about to wipe that page!!)
Paul.G
Old 27 August 2001, 11:31 AM
  #7  
Branners
Scooby Regular
 
Branners's Avatar
 
Join Date: Sep 1999
Posts: 243
Likes: 0
Received 0 Likes on 0 Posts
Post

I use thumbnails and javascript on one of my sites and I do it that way so that it opens up the large picture into a new window which then keeps the original window the same without having to reload all the thumbnails. This can be achieved by just sending it to a _blank target but then it opens up into a new window each time without closing the other one, and if you just send it to the same target each time it loads the picture into the window without bring the window to the front. With the javascript I use it closes the large picture window before opening a new one and makes sure the new one is on top.

to be honest, if I redid my site, Im not sure I would do it that way again. I tend to do a 'shift click' on the thumbnails to make them open in new windows and if theres javascript behind the thumbnail the shift click doesnt work.

JB

Trending Topics

Old 27 August 2001, 01:58 PM
  #8  
Paul.G
Scooby Regular
Thread Starter
 
Paul.G's Avatar
 
Join Date: Jan 2000
Posts: 164
Likes: 0
Received 0 Likes on 0 Posts
Thumbs up

Thanks everyone,
Lee, that answers my questions perfectly. Can you recommend any good JavaScript tutorial URL’s?

Thanks,
Paul.G
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
KAS35RSTI
Subaru
27
04 November 2021 07:12 PM
slimwiltaz
General Technical
20
09 October 2015 07:40 PM
IanG1983
Wheels, Tyres & Brakes
2
06 October 2015 03:08 PM
Brzoza
Engine Management and ECU Remapping
1
02 October 2015 05:26 PM
the shreksta
Other Marques
26
01 October 2015 02:30 PM



Quick Reply: Javascript Question



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