Forum Moderators: open
I checked out the code, and the .js file is just plain huge, as it appears to cover all scripts for the entire site. I don't know enough JS to be able to decipher what of this script is necessary for the image enlarging function to run. Has anyone seen an easy way of getting an effect just like this?
P.S.: In case the URL gets edited, or no longer goes to the right page (it's an inventory page), just look at any Porsche dealer's website for a car with pictures.
[edited by: jatar_k at 7:10 pm (utc) on Aug. 22, 2005]
[edit reason] removed url [/edit]
Yes, I had tried pulling the specific functions out of the JS... but either i'm an idiot (most likely) or there is a lot of intertwined info in the code, because those functions alone still come up with JS errors... I have to copy over about 1/6 of the entire JS file before all the errors go away... and that's a bit too much for me, as i'd feel like i was blatantly stealing the script at that point.
Um, I just had an idea to mimic this effect. It might be one of those "no you stupid newbie, it doesn't work that way" things... but, couldn't i just do this?
<img src="erf.jpg" width="300" height="225"
onclick="height='480', width='640'" ondblclick="height='225', width='300'" />
another option, which I have done before when trying to understand how something works.
copy the relevant code then put up the full js file, from there start chopping function by function until you get to the quick.
The way to understand it is to read it, then start grabbing all the pieces. My js is not great but I do alright.
function clickZoomable
function clickZoomed
function showLr
function hideLr
those are at least the functions you need and this declaration from the top of the file
var g_openZoom = 0;
the basic definition of what it seems to be doing is just show/hide layers. Those 4 big pics are there, you just can't see them until you click. The function makes the appropriate layer visible. Then when you click on the now visible layer it hides it again.