Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #24587

Re: window.open allowing image to scale

Date 2014-06-03 13:19 +1000
From Andrew Poulos <ap_prog@hotmail.com>
Newsgroups comp.lang.javascript
Subject Re: window.open allowing image to scale
References <_oqdnbF7roH_oBDOnZ2dnUVZ_qudnZ2d@westnet.com.au>
Message-ID <icydndWnyInWohDOnZ2dnUVZ_oKdnZ2d@westnet.com.au> (permalink)

Show all headers | View raw


On 3/06/2014 1:11 PM, Andrew Poulos wrote:
> I need to be able to popup a window to enable users to see the image
> they've selected. The simplest way I thought of using was to point
> window.open to the image itself.
>
> This works but the image will rescale (at least it does in IE 9) if the
> popup window is resized to smaller than the image's "natural" size:
>
> var myPop = window.open(
>    "images/puzzle.jpg",
>    "",
>    "width=240,height=320,resizable,status=0"
> );
>
>
> Is there a way to keep the image from scaling?

To answer my own question, I just did this

var myPop = window.open("","","width=240,height=320,resizable,status=0);
myPop.document.open();
myPop.document.write("<img src='images/puzzle.jpg' alt=''>");
myPop.document.close();

and the image now doesn't scale when the window is made smaller than the 
image.

Andrew Poulos

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

window.open allowing image to scale Andrew Poulos <ap_prog@hotmail.com> - 2014-06-03 13:11 +1000
  Re: window.open allowing image to scale Andrew Poulos <ap_prog@hotmail.com> - 2014-06-03 13:19 +1000
    Re: window.open allowing image to scale "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-03 08:55 +0200
      Re: window.open allowing image to scale Andrew Poulos <ap_prog@hotmail.com> - 2014-06-03 18:38 +1000
        Re: window.open allowing image to scale "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-03 10:58 +0200
      Re: window.open allowing image to scale Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-06-04 11:28 +0200
        Re: window.open allowing image to scale "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-04 15:01 +0200
          Re: window.open allowing image to scale Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-06-04 15:16 +0200
            Re: window.open allowing image to scale "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-04 16:51 +0200
        Re: window.open allowing image to scale John Harris <niam@jghnorth.org.uk.invalid> - 2014-06-04 14:47 +0100
          Re: window.open allowing image to scale Christoph Michael Becker <cmbecker69@arcor.de> - 2014-06-04 17:35 +0200
            Re: window.open allowing image to scale Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-06-04 18:18 +0200
              Re: window.open allowing image to scale John Harris <niam@jghnorth.org.uk.invalid> - 2014-06-05 11:12 +0100
            Re: window.open allowing image to scale John Harris <niam@jghnorth.org.uk.invalid> - 2014-06-05 11:03 +0100
              Re: window.open allowing image to scale Christoph Michael Becker <cmbecker69@arcor.de> - 2014-06-05 17:43 +0200
                Re: window.open allowing image to scale John Harris <niam@jghnorth.org.uk.invalid> - 2014-06-06 11:09 +0100
              Re: window.open allowing image to scale Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-06-08 19:41 +0100

csiph-web