PDA

View Full Version : Live thumbnail script opens new window



vrm
08-07-2006, 11:21 PM
Hi Folks,

I am not a programmer and so use scripts developed by others.

Chris Klimas developed this neat script that allows the thumbnail to resize within the page.

I tried to combine the features of 2 modified scripts:
-- a version that automatically scales down other images on the page when you click one, ensuring that only one is maximized at a time. (http://diverged.org/thumbnail/klimas/ )
-- a version with valid code (http://diverged.org/thumbnail/konkiel/ )

I made a mistake somewhere in applying the code, so when you click on an image, it opens a new browser window.
The problem page (http://www.cmsboston.org/events/hype2006/photos.html )

I would appreciate help in finding my error.

Sincerely,
VRM

vrm
08-08-2006, 02:42 AM
This script goes in the body of the web page following the photos. Since I am not a programmer, I do not understand why.

VRM

mburt
08-08-2006, 02:47 AM
Sorry, but when I clicked on the images, a browser window did infact, not appear. I'm not sure on the problem you're searching for :)

vrm
08-08-2006, 02:53 AM
I had originally put the javascript in the "head" of the web page. When I moved to the body, following the photos, the script worked. Since I am not a programmer, I do not understand why.

VRM

mburt
08-08-2006, 02:59 AM
Oh, right. If you have an element in the <body>, and you are trying to access it (using event handlers) in the <head> it won't work. You have to call them in the body, or you could just, as you said put the whole code in the body :)