Re: image size

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Steve Easton (admin_at_95isalive.com)
Date: 12/15/04


Date: Wed, 15 Dec 2004 09:02:22 -0500

Interesting.
Declaring the variables as global really isn't necessary, but it doesn't hurt anything.

Haven't gotten it to work correctly in Mozilla, Netscape, Firefox yet . But I think the issue is
that the margin info written to the popup has to be set with a style tag rather than inline

Also, I think it's easier if you create a string variable and then use the variable in window.open
like this.

sVar1="left=20"+",top=20"+",Width="+sizew+",Height="+sizeh;

then

newwindow=window.open('','',sVar1);

Here's my "test" page. Haven't tested it in XP SP 2 or Firefox though, so it may be "quirky."

http://www.95isalive.com/test/

the script is in the page.

-- 
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
.......................with a computer
"sbrixner" <sbrixner@discussions.microsoft.com> wrote in message
news:CF1743E3-4476-4548-A04A-86DA6A161DED@microsoft.com...
> Thanks very much.  I have implemented a revised script on my page.  There
> seems to be a limit as to how small a window can be, and it doesn't seem to
> work in Firefox.  Works in Netscape 7 but is a bit slow.  You can see the
> results at:
>
> http://www.brixnerdesign.net/milton/catalog.asp
>
> As you move the mouse pointer over the titles, a thumbnail image will appear
> if one exists.  The more recent the date, the more likely there is to be an
> image.
>
> Steve Brixner
>
> "Steve Easton" wrote:
>
> > The script also needs a closing }
> >
> > <SCRIPT type=text/javascript>
> > function getsize(img){
> > imga = new Image();
> > imga.src=(img);
> > sizew=eval(imga.width);
> > sizeh=eval(imga.height);
> > alert("width="+sizew+",height="+sizeh);
> > }
> > </script>
> >
> >
> > -- 
> > Steve Easton
> > Microsoft MVP FrontPage
> > 95isalive
> > This site is best viewed............
> > ........................with a computer
> >
> > "Steve Easton" <admin@95isalive.com> wrote in message
> > news:%23oDAzhj4EHA.3472@TK2MSFTNGP09.phx.gbl...
> > > That's easy. Funny you should ask, I'm working on a script that will automatically display any
> > size
> > > image in the appropriate window, simply by reading the image size and then creating the
window.
> > >
> > >
> > > The following will return the dimensions of an image.
> > >
> > >
> > > <SCRIPT type=text/javascript>
> > > function getsize(img){
> > > imga = new Image();
> > > imga.src=(img);
> > > sizew=eval(imga.width);
> > > sizeh=eval(imga.height);
> > > alert("width="+sizew+",height="+sizeh);
> > > </script>
> > >
> > >
> > > To make it work, use an onclick event containing the name of the image you want to find the
> > > dimensions of
> > > like this
> > >
> > > onclick="getsize(imagename.jpg)
> > >
> > > With this one the image needs to be in the same location as the page running the script.
> > >
> > > hth
> > >
> > > Steve Easton
> > > Microsoft MVP FrontPage
> > > 95isalive
> > > This site is best viewed............
> > > .......................with a computer
> > >
> > > "sbrixner" <sbrixner@discussions.microsoft.com> wrote in message
> > > news:7C988056-BE8E-476E-B9B8-EF9BE0DBE19C@microsoft.com...
> > > > The height and width in pixels.  Thanks.  Steve.
> > > >
> > > > "Steve Easton" wrote:
> > > >
> > > > > Do you mean height and width or file size??
> > > > >
> > > > > -- 
> > > > > Steve Easton
> > > > > Microsoft MVP FrontPage
> > > > > 95isalive
> > > > > This site is best viewed............
> > > > > ........................with a computer
> > > > >
> > > > > "sbrixner" <sbrixner@discussions.microsoft.com> wrote in message
> > > > > news:22F82495-FD79-4FBC-90AA-20E4BED54E14@microsoft.com...
> > > > > > Is there a way of retrieving the size of an image located on the server?
> > > > > > Thanks.  Steve Brixner
> > > > >
> > > > >
> > > > >
> > >
> > >
> >
> >
> >


Relevant Pages

  • Re: BrowserBookmarksApplet, and "firefox -chrome ..." cant use default profile
    ... provided that I don't already have an instance of firefox up ... had the same issue with Netscape when showing an URL (eg clicking ... on a link from my mail app). ... I resorted to calling a script instead ...
    (Fedora)
  • Re: browser statistics
    ... :I would like to have a script like ... :more options as firefox, netscape, safari, etc... ...
    (comp.lang.php)
  • Re: Deselecting text in input text box
    ... when the user tabs to the item or if the user clicks on it. ... It is impossible to reliably prevent either of the above using script. ... fine for IE 6 but it works in neither Netscape 7 nor Firefox 1.0. ...
    (comp.lang.javascript)
  • Re: Internet Explorer - Firefox
    ... Firefox, the problem is how publisher displayed it in IE. ... I imagine it is a problem with how the script is ... suppose to display a search box for flights..i am pretty sure that the ...
    (microsoft.public.publisher.webdesign)
  • RE: error script with music
    ... Try to Disable all Add-Ons for Firefox for now, you will bring it up later ... In the IE Propertise Go to the Programs Tab and Navigate to Manage Add-Ons ... "nass" wrote: ... Internet Explorer Script Error ...
    (microsoft.public.windows.inetexplorer.ie6.browser)