Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Pop-Ups in FireFox - I need a pop-up expert!


WoodsWalker

Recommended Posts

Hi, All!

 

I have always noticed that my pop-up images in FireFox looked a little "muddy", and I didn't know why. Today I decided to check things out, and I discovered that the pop-up image size was "expanded" by about 10%, explaining the loss of focus.

 

I checked the same thing in IE, and IE doesn't do it. In IE the image is the original size and nice and sharp.

 

There are no browser-specific resize instructions or any other confusing stuff in my catalog/popup_image.php. It's pretty much stock. In fact, the same problem still occurs if I remove the JavaScript resize script altogether. When I do this, the pop-up frame in Firefox comes up about 1 inch by 1 inch, but when I pull it open, the image inside is still "explanded" and out of focus.

 

Here is my popup_image.php:

 

<?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 i=0;
function resize() {
 if (document.images[0]) window.resizeTo(document.images[0].width +100, document.images[0].height+180-i);
 self.focus();
}
//--></script>

</head>
<body onLoad="resize();">
<?php echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']); ?>
</body>
</html>
<?php require('includes/application_bottom.php'); ?>

 

Could any other commands in this file be causing my problem?

 

Thanks for any help.

~Wendy

Link to comment
Share on other sites

Firefox tries to resize images to fit the window. You might be able to size the window using Javascript so this doesn't happen, but I doubt it's worth the effort. The only other way is to change the setting in Firefox, but that will only work for your personal copy (and the rest of us who've already made the change.)

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Thanks, Jim - that sheds some light on things.

 

I'd already figured out that it was a FireFox-specific issue. In my popup_image.php, I altered the Javascript segment several months ago, adding a bit to the window width and height, because the popup window that Firefox generated was always too small and cur off the image. Perhaps I should twiddle a bit more.

 

Another thing of note is that my husband's version of FireFox, which is older (his is 2.0.6 and mine is 3.0.1) does not do any of this - it renders the popup image nice and sharp, in a proper-sized window.

 

Thanks again,

~Wendy

Link to comment
Share on other sites

Some older versions of Firefox had the automatic resize turned off by default. I don't remember which way 2.x had it, but 3.x has it on by default (and you have to edit the config file to turn it off.)

 

You can do browser detection and resize the window accordingly. I've never had much luck with this, and eventually just gave up.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

You can do browser detection and resize the window accordingly. I've never had much luck with this, and eventually just gave up.

 

Yes, I tried a contribution for that, but it just screwed things up - the FireFox popup window started appearing hidden behind the main browser window, and in IE it popped up way off to the left ... so I removed the mod.

 

I've seen references on the web to that "resize" function (it's in FireFox's "about:config"), but this didn't directly pertain to my problem - it was more to do with Javascript-generated Firefox windows that popped up too small and could not be resized by click-and-drag.

 

I'll tinker a little more...

Link to comment
Share on other sites

  • 4 weeks later...

I had a similar problem with my pop-up images in Firefox. I think it's because I changed my large image sizes to 426x568. To fix it, I messed around with the width and height attributes in the javascript on line 30 of popup_image.php. What I'm using is "width+25" and "height+130-i" but I think what you use will depend on your large image size.

 

Hope that helps.

Link to comment
Share on other sites

  • 4 weeks later...

NEWS FLASH!

 

I am a stupid dummy-head. :lol:

 

I finally noticed while twiddling something else that all my images (not just pop-ups, although it's more obvious with them) render larger with Firefox than with IE or in my graphics program.

 

I tried going to Firefox's "View" menu to see if I was for some reason zoomed in. Hit Zoom>Reset, and "poof", the pages got a little smaller and all the images, including the pop-ups, are sharp now.

 

I know I never intentionally changed that Zoom setting - perhaps it was set that way by default. Who knows, but my pop-up dilemma is fixed! B)

 

~Wendy

p.s., And, whaddya know, the osC Forum looks better, too! :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...