Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with image viewer code

Status
Not open for further replies.

Aztech1

Technical User
Mar 1, 2009
33
LV
I just looked for popup image viewer, and I find that Amazon image viewer example will be very close to my needs. Here is Amazon page:
and Viewer code:

The viewer code contains a lot of extra code which, probably is not related to image viewer itself but related to other amazon applications, so I just wanted just clean code from extra stuff, to make it more compact and clean. I get confused to define purpose of some parts of code. Could someone help and specify exact parts of code that not related to viewer itself, so can be removed? Just comment unnecessary code blocks.
 
I am not a programmer. I think there's no need to invent a bicycle, then, it seems product viewer is a very common task.
 
Hi

Correct, no need to invent a bicycle. But is still preferable to build one from pieces than to modify a truck into a bicycle.

But let us skip the philosophy part. Tell us about your site and how the image viewer will have to fit it.

Feherke.
 
currently I just use basic popup, based on JustSoPicWindow script (developed as Dreamweaver extension) - outdated, non standards-compliant script.

I just call popup this way:
<a href="javascript:;" onclick="JustSoPicWindow(' * Click to close * *','#FFFFFF','hug image','0');return document.MM_returnValue"><img src=" alt="" title="Enlarge" align="right" border="0" height="300" hspace="10" width="94"></a>

here is site example that uses this script:
 
Hi,

I tried Lightbox, Thinbox, Greybox - all these look the same. I don't like their idea for showing image this way, changing opacity of the background and non-dragable, static popup. Thats looks annoying. Classic popup window still more handy.
 
Hi

Aztech1 said:
Classic popup window still more handy.
I hate them. And I hate sites that use popup windows.

Anyway, what is wrong with the traditional code ?
Code:
<a href="image.png" onclick="window.open(this.href,''); return false"><img src="image_thumbnail.png"></a>

Feherke.
 
Most professional and corporate websites use standard popups. They mostly need get exact technical info, specs, product description, view item from different sides. So the simpler the better. Lightbox does not suit these needs.
 
Hi

Ok, but so far we know more about what you not want.
Feherke said:
Tell us about your site and how the image viewer will have to fit it.
[ul]
[li]Will the popup links be in static HTML or in dynamically generated pages ?[/li]
[li]The popup has to contain only an image or a HTML document with the image ?[/li]
[li]There will be the image alone or accompanied with additional information ?[/li]
[li]If the popup will contain a HTML document, it will have navigational links to change the whole document or just the image ?[/li]
[/ul]

Feherke.
 
Hi,

Amazon style popup look quite good for me (maybe small images need be centered under main image, like in main page), just need be opened in center of page.
The things is same as in Amazon page, popup is HTML document with images.
I think, it will be not rational to have separate html page for each image. So probably better to have viewer as dynamically generated page, where changes just image urls. (dont know though where and how this can be implemented into code).
 
Hi

Ok. So I understand you also have kind of product information. Which are probably stored in a database.
[ul]
[li]The images are stored in the database or in files ?[/li]
[li]What is the relation between the products and the images ?[/li]
[/ul]

Feherke.
 
Images stored in files, in images folder. (there is an option to add small/big image popup from CMS admin, but I not use due bug in add_image_popup.php, can no add image to database, code encryped with Zen Encoder, can no find source).

As to relation, the product descrption will have regular image, when click on it(or on link below) this will open viewer. This viewer will not for all cases, but only when it required, for complex products, etc. I will still use regular popup to show big image when this is enough.
 
images/I/BigSf435.jpg" or just "images/BigSf435.jpg"
"images/Thumbs/tn3_1905127.jpg" for small
 
Hi

Got it. So no logical naming scheme is used.

That would mean, the relation between products and images are stored in the database. So something will have to read out those information. And that one must be a server-side script.

I would say this depends so much on the server-side that is pointless to discuss it further in this thread. At least for now.

Post this question in forum434 and provide more details about the site. As I understand it uses a site engine available on the web. If so, specify which.

Feherke.
 
or better, someone know ready copy-n-paste script exactly as amazon one?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top