Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: DHTML Modal window Resize?

  1. #1
    Join Date
    Jan 2008
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DHTML Modal window Resize?

    1) Script Title: DHTML Modal window v1.01

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...dhtmlmodal.htm

    3) Describe problem: Is there a way to have the window auto resize to a new size when a link is link on in the window??

    http://stevetoms.com/dhtmlwindow/ftgairlines2.htm

    For example, on Air France-KLM, when I click the F icon, can the window become smaller??

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    You should be able to do this by calling the setSize(w, h) method. For a list of methods available, see: http://www.dynamicdrive.com/dynamici...ndow/index.htm

  3. #3
    Join Date
    Jan 2008
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    So do I put the code on the page where all my logos are, or the windowed page?

  4. #4
    Join Date
    Jan 2008
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I want to make sure people know what I am asking, I know I can have a resize on the main page, but how do I make it work on the DHTML Modal Window that opens?

  5. #5
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    If you wish to resize the DHTML window from within the page contained within this window, you can do so by referring back to the main page first, then calling setSize(w, h). For example, lets say on your main page, you've opened up a DHTML modal window:

    Code:
    <script type="text/javascript">
    var mysurvey=dhtmlmodal.open("surveybox", "iframe", "survey.htm", "Fill out this survey", "width=700px,height=450px,resize=1,scrolling=1,center=1", "recal")
    </script>
    Then inside survey.htm, you wish to create a link that resizes the window it's contained in. You would do something like:

    Code:
    <a href="#" onClick="parent.mysurvey.setSize(500, 400); return false">Resize Me</a>
    In other words, the key is to call "parent" in front of the method you wish to run, when that method is being called from the DHTML window itself.

  6. #6
    Join Date
    Jan 2008
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Still a tad confused. First is there a way I can not have it auto open? Second, how do I make it work for click to open?

  7. #7
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    A DHTML modal window can be set to open when you click on a link, for example. This is actually already demonstrated in demo #2 and #3 on the script page. The code would look something like:

    Code:
    <script type="text/javascript">
    
    function opennewsletter(){
    //Open a modal window with an iframe page inside, and assign the result to a global variable called "emailwindow"
    emailwindow=dhtmlmodal.open('EmailBox', 'iframe', 'modalfiles/newsletter.htm', 'Newsletter Signup page', 'width=350px,height=200px,center=1,resize=0,scrolling=1')
    
    </script>
    
    <a href="#" onClick="opennewsletter(); return false">Signup for our newletter:</a> <span id="youremail" style="color: red"></span>

  8. #8
    Join Date
    Jan 2008
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I got it now thanks
    Last edited by SteveToms; 01-07-2008 at 01:11 PM.

  9. #9
    Join Date
    Jan 2008
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I know can't seem to get the link to change links, bascially the page reloads the old page

  10. #10
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Quote Originally Posted by SteveToms View Post
    I know can't seem to get the link to change links, bascially the page reloads the old page
    Do you have an example of this I can see on your page?

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
  •