SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict Phil-man's Avatar
    Join Date
    Nov 2000
    Posts
    291
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Auto-sizing of Popup Window Based on Content

    Hi. I'm wondering if there's a way to auto-size the dimensions of a popup window based on the content that appears in that window. Actually, the width in my case is always going to be the same, but the height will change depending on the "length" of the content in the popup window. I'm trying to make everything as automatic as possible, so I don't want to have to manually determine (and set) the height each time. Anybody have any ideas?

  2. #2
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not off the top of my head. I tried a couple of things that might have worked. Could you pass a variable with your function call telling it the size of the information.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  3. #3
    SitePoint Addict Phil-man's Avatar
    Join Date
    Nov 2000
    Posts
    291
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not off the top of my head. I tried a couple of things that might have worked. Could you pass a variable with your function call telling it the size of the information.
    Not really. The gist of this is that an administrator creates online polls to be displayed in popup windows. The number of response choices varies by poll, as does the text length of each response choice. So, to the best of my knowledge, there's no way for me to figure out what the height of the popup window should be without doing it manually.

    If, however, the window can pop up and, in effect, resize itself so that it's only as big as it needs to be, that would be perfect. I just don't know if it's possible.

    Thanks.

  4. #4
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Phil-man

    If, however, the window can pop up and, in effect, resize itself so that it's only as big as it needs to be, that would be perfect. I just don't know if it's possible.

    Thanks.
    I will look around but I am pretty sure it isn't. I can think of a couple of ways it might be. Here is my idea

    detect if scrollbar is required and then resize to another size. If scroll bar is still required resize again.

    I am just not sure if scrollbar is a readable value so I will try to look that up.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.


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
  •