SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Oct 2001
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Height in new window

    I have an image gallery, and the thumbnails call a script to open the larger image in a new window. All of the images are the same width but not the same height. So why doesn't this work...

    window.open(url, "p", "WIDTH=420, HEIGHT=auto, resizable=no")

    Thx!

  2. #2
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had that problem too, so I ended up creating pop-up scripts for each size. I have 5 in total - 4 different sizes but I have to have portrait and landscape versions for one of them.

    The scripts are in an external file, so I've only had to create each one once, and then I can call the appropriate size as and when I need to.
    Saz: Naturally Blonde, Naturally Dizzy!
    No longer Editor of the Community Crier.

    Don't mind me, I'm having a BLONDE moment!

  3. #3
    SitePoint Member Ralf-J's Avatar
    Join Date
    Oct 2001
    Location
    Hannover, Germany
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    swishboy,

    simply open a window with a fixed height and put the images centered into a document (!) which fits the largest image.

    Or, if you have only a few pictures you could do it this way:

    By using the onClick() event on your thumbnail you could send the url,width,height of the picture to a function which opens a window and does a resizeTo(x,y).

    the onClick() could look like this:

    onClick='openWin('graphic/picture1.jpg',420,300)'

    the function:

    var newwin;
    var url;
    var x;
    var y;

    function openWin(url,x,y)
    {
    newwin = open.window(url,"p",Width='10',Height='10',
    resizable='no');

    newwin.resizeTo(x,y);
    }

    I'm not sure if you could pass x,y directly to Width and Height, just try it.

    regards

    Ralf-J.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •