PDA

View Full Version : Self resizing popup_image.php depending on picture size



michael_s
04-22-2007, 02:59 PM
Self resizing popup_image.php depending on picture size

------------------------------------------------------------------------------
This contrib comes originally from two other popup contributions

http://www.oscommerce.com/community/contributions,2240
http://www.oscommerce.com/community/contributions,2503

So all credits go to the original coders.
------------------------------------------------------------------------------

As I am using pictures with different heights and widths I modified the script and made it comfortable for me.
Check it and use it if you like.

This popup_image.php shows the product name, the big picture, the price and the product description.

The popup will resize itself according to the size of the picture no matter if there are different picture sizes.

The popup window will close itself when clicked into the popup or into the main window.

The visitor does not have to click any window-shut-down button, just does anything and the window is closed.

So there is even a little prevention of steeling pics (not for the cracks of course).

Depending on the length of your product description you have to adapt the length of the window by increasing/decreasing the

value 300 in line:
imgHeight = document.images[0].height+300-i;

If you want to adjust the place where the popup appears on the screen you have to do this in catalog/product_info.php
find the javascript definition function popupWindow(url) and change the values for 'top' and 'left'.

--------------------------------------------------------------

Step 1. Backup your files first :-)) do it

Step 2. copy the popup_image.php to the folder catalog

---------------------------------------------------------------

greetz pillepalle

More... (http://www.oscommerce.com/community/contributions,5081)