SparkFun Forums 

Where electronics enthusiasts find answers.

General suggestions or questions about the SparkFun Electronics website
By meander
#3822
the extra images that you have are great, im sick of all the sites that say click here for a larger image and give you one that is 1 pixel bigger. but every time i click on one of those links, it opens in a REALLY tiny window and i have to resize it a great deal to see teh whole thing. just thought id let you know in case theres something you can do about it.
By Pete-O
#3830
Thanks for the feedback. Yeah, it is a really tiny window, isn't it? That issue seems to be a Mozilla Firefox thing (doesn't happen with IE). If we were more web-savvy, we might be able to find a fix for that. But for now we have to live with it, sorry.

Pete
By Pryankster
#3853
Pete-O:

Try updating your javascript generated by the clseimg.php script to look something like this:
Code: Select all
var isNav4, isIE4, isFirefox;
if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
        isFirefox = (navigator.userAgent.indexOf("Firefox") != -1) ? 1 : 0 ;
	isNav4 = (navigator.appName == "Netscape") ? 1 : 0;
	isIE4 = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
}

function fitWindowSize() {
if (isFirefox) {
        window.innerWidth = document.images[0].width;
        window.innerHeight = document.images[0].height + 50;
} else if (isNav4) {
	window.innerWidth = document.layers[0].document.images[0].width;
	window.innerHeight = document.layers[0].document.images[0].height;
} else if (isIE4) {
		window.resizeTo(500, 500);
		width = 500 - (document.body.clientWidth -  document.images[0].width);
		height = 500 - (document.body.clientHeight -  document.images[0].height) + 50;
		
		window.resizeTo(width, height);
   }
}
However, this doesn't work if the option "tools->options->web features->enable javascript->advanced->allow scripts to->move or resize existing windows" is not checked.

-- pryankster
By Pete-O
#3874
Holy Cow!!

Alright, if you're going to go to the trouble of spelling it out for me, I'm gonna have to go see if I can fix it. I won't promise when it might all get done, but I'll have a look. Thanks.

Pete
User avatar
By sparky
#4019
Pryankster,

You are my new best friend for the day! I'll send you a gift cert for $10 off your next order.

We are hardware guys. I manged to write just enough php to get an image window open. But when Firefox came along, I didn't know what to do. Thanks for making Firefox that much nice to use with the SFE site.

-Nathan
By Pryankster
#4031
Not necessary, but thanks! I'm sure I'll use way more than $10.00 worth of tech support once my boards arrive :-)

You can get around firefox's resizing restrictions by specifying the size of the window when the popup opens. You'll have to modify your catalog page generator to pass that information in when generating the catalog page with the 'big picture' links, though.

(software guy trying to get his hardware-mojo going)
-- Pryankster
By MGP
#4062
Excellent work guys! And thanks to Pryankster too. As a Firefox user I appreciate not having to manually resize the image windows.

:)