views:

732

answers:

5

By default in Firefox every time you open an image it will re-size to fit within the browser window, now if you view a lot of images this can become annoying having to click on the image every time it loads to see it full size.

There is a way to switch off that in about:config, but this is not a solution for a broader public.

Is there a way to switch that off by some JavaScript function, or CSS, or something else?

+1  A: 

I dont think there is anyway to change that behavior, at least using javascript or css.

Why not use a jQuery Lightbox? http://leandrovieira.com/projects/jquery/lightbox/

Daniel A. White
+1  A: 

Though I have not tried it, I don't see why it would autosize if you wrapped it in html and not link directly to the image.

if that is an option, just wrap it in html:

<style type="text/css">
 * { margin:0; }
</style>
<img src="whatever.jpg" />
Chad Grant
+3  A: 

Point to a dynamic page that uses an IMG tag with the appropriate source, rather than pointing to the raw image. Use the querystring or something similar to pass the image name to the page.

<html><body><img src="yourimage.jpg"></body></html>
great_llama
From my understanding the OP refers to opening an image URL directly in the browser, e.g. http://stackoverflow.com/content/img/so/logo.png
0xA3
You're right, I didn't answer the question... "Is there a way to switch that off by some JavaScript function, or CSS, or something else?"No. There isn't. When the image is pointed to directly, there is no stylesheet and no JavaScript, as you're not viewing an HTML page.You'll have to find some other way to work around it, like bringing in a script-driven Lightbox, or something like what I recommended in the way of not directly pointing to the image. These are the solutions you're left with for the broader public.
great_llama
+1  A: 

If you are the owner of the image, embed the image in an HTML document. Firefox resizes an image only if you open it directly in the browser.

If you are talking from a Firefox user's point of view, I think about:config is the appropriate place to disable this functionality.

Ayman Hourieh
+4  A: 

If you would like to switch off auto-resizing images in your browser, then you can

  • type about:config
  • search for property browser.enable_automatic_image_resizing
  • and set it to false

If you want it for your visitors, I just can repeat what Jeremy Sydik writes in Design Accessible Web Sites,

it’s just their web, we’re building on it.

And in this case, you really shouldn't decide whether your users want Firefox's auto-resizing feature or not. You can always choose a solution that gives better user experience to your visitors. For instance, you may install a Lightbox variant as Daniel A. White already mentioned.

There is also great_llama's solution to open images inside a HTML page.

Török Gábor
and to do this programmatically, this advice can be used: http://stackoverflow.com/questions/843340/firefox-proxy-settings-via-command-line/843366#843366
dmityugov