Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Popup Image


JoshNelson

Recommended Posts

Posted

I know it's been asked a million times, but how do i make the popup image of my product reflect the actual dimensions of the larger image? I click a product image now and the popup image is about one inch square.....and shows barely any of the actual image.

 

I thought there was something where i could just delete the entry for the height or width of the image in the admin, but i haven't had any luck thus far. Can anyone help?

 

Thanks,

 

Josh

Posted
No problem!

 

 

Maybe I spoke too soon. I just tested with FirFox and didn't see the image resize like i did in IE7. Any ideas why? the install file doesn't seem to mention any issues and looking at the code i don't see anything about FF mentioned......IE and Opera.....but not FF....but i don't know javascript so i could very well be missing it.

 <script language="javascript"><!--
var agt=navigator.userAgent.toLowerCase();
var i=0;
var is_major = parseInt(navigator.appVersion);
var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie7 = (is_ie && (is_major == 4) && (agt.indexOf("msie 7.")!=-1) );
var is_opera = (agt.indexOf("opera") != -1);
function resize() {
 window.moveTo(10,10);
 if (is_ie && !(is_ie7))
{
  i=100
}
else if  (is_ie7)
{
  i=120
}
else if (is_opera)
{
  i=80
}
else
{
  i=90
}
 if (document.images[0]) window.resizeTo(document.images[0].width +40, document.images[0].height+i);
 self.focus();
}
//--></script>

 

Is there an "if" i can add to that to make it work in FireFox?

Posted
Maybe I spoke too soon. I just tested with FirFox and didn't see the image resize like i did in IE7. Any ideas why? the install file doesn't seem to mention any issues and looking at the code i don't see anything about FF mentioned......IE and Opera.....but not FF....but i don't know javascript so i could very well be missing it.

 <script language="javascript"><!--
var agt=navigator.userAgent.toLowerCase();
var i=0;
var is_major = parseInt(navigator.appVersion);
var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie7 = (is_ie && (is_major == 4) && (agt.indexOf("msie 7.")!=-1) );
var is_opera = (agt.indexOf("opera") != -1);
function resize() {
 window.moveTo(10,10);
 if (is_ie && !(is_ie7))
{
  i=100
}
else if  (is_ie7)
{
  i=120
}
else if (is_opera)
{
  i=80
}
else
{
  i=90
}
 if (document.images[0]) window.resizeTo(document.images[0].width +40, document.images[0].height+i);
 self.focus();
}
//--></script>

 

Is there an "if" i can add to that to make it work in FireFox?

 

or maybe FF and all others i guess are covered in that last else where i=90.....

 

Are you using this contrib? does it work in FF?

 

 

Thanks again,

 

Josh

Posted

Yeah, I use FF and it works fine for me.

 

Can you rename your popup_image.php to popup_image.php.bak and upload the contribution file? Maybe you didn't do something quite right and this would tell you if it is working in FF.

Posted

Here's my popup_image.php......i'm pretty confident i followed the contrib instructions correctly.

 

<?php
/*
 $Id: popup_image.php,v 1.18 2003/06/05 23:26:23 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 $navigation->remove_current_page();

 $products_query = tep_db_query("select pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'");
 $products = tep_db_fetch_array($products_query);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo $products['products_name']; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<script language="javascript"><!--
var agt=navigator.userAgent.toLowerCase();
var i=0;
var is_major = parseInt(navigator.appVersion);
var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie7 = (is_ie && (is_major == 4) && (agt.indexOf("msie 7.")!=-1) );
var is_opera = (agt.indexOf("opera") != -1);
function resize() {
 window.moveTo(10,10);
 if (is_ie && !(is_ie7))
{
  i=100
}
else if  (is_ie7)
{
  i=120
}
else if (is_opera)
{
  i=80
}
else
{
  i=90
}
 if (document.images[0]) window.resizeTo(document.images[0].width +40, document.images[0].height+i);
 self.focus();
}
//--></script>
</head>
<body onload="resize();">
<?php echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']); ?>
<center>
<input type="button" align="right" name="close" value="Close" onClick="window.close()">
</center>
</body>
</html>
<?php require('includes/application_bottom.php'); ?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...