Results 1 to 8 of 8

Thread: Modless Window HELL oops I mean Help

  1. #1
    Join Date
    Nov 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Modless Window prolblems

    I need to have a modless window open only on click what needs to be removed to accomplish that?

    this is what I have:

    <script>

    //Modeless window script- By DynamicDrive.com
    //for full source code and terms of use
    //visit http://www.dynamicdrive.com

    function modelesswin(url,mwidth,mheight){
    if (document.all&&window.print) //if ie5
    eval('window.showModelessDialog(url,"","help:0;resizable:0;dialogWidth:'+mwidth+'px;dialogHeight:'+mheight+'px")')
    else
    eval('window.open(url,"","width='+mwidth+'px,height='+mheight+'px,resizable=0,scrollbars=1")')
    }

    //configure URL and window dimensions (width/height)
    modelesswin("http://www.yahoo.com",840,600)

    //To load via link, use something like below:
    //<a href="javascript:modelesswin('http://yahoo.com',600,400)">Click here</a>
    </script>
    Last edited by pjdbck; 11-25-2005 at 03:50 PM.

  2. #2
    Join Date
    Nov 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I did not include a url to the page with the previous question because it is not live let, does any one have any answers? is this possible?

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

    Default

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format for asking a question., in this case: http://www.dynamicdrive.com/dynamici...odelesswin.htm

    Actually this is already explained inside the script:

    Code:
    //configure URL and window dimensions (width/height)
    modelesswin("http://www.yahoo.com",840,600)
    
    //To load via link, use something like below:
    //<a href="javascript:modelesswin('http://yahoo.com',600,400)">Click here</a>
    In other words, such a link would look like:
    Code:
    <a href="javascript:modelesswin('http://yahoo.com',600,400)">Click here</a>

  4. #4
    Join Date
    Nov 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    OK I am not trying to be stupid but i am beginning to feel that way... Are you saying that I need to replace :


    Code:
    //configure URL and window dimensions (width/height)
    modelesswin("http://www.yahoo.com",840,600)
    with:

    Code:
    <a href="javascript:modelesswin('http://yahoo.com',600,400)">Click here</a>
    because if so that does not work. I want the modless window to open only on click not automatically when that page is loaded.

    Feeling stupid....

    Paul

  5. #5
    Join Date
    Nov 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation

    OK I am stupid...

    Here is the real question can I place:

    Code:
    <a href="javascript:modelesswin('http://yahoo.com',600,400)">Click here</a>
    in a flash movie that is the menu on the page?

    Will this script work or should i try somehting else

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by pjdbck
    OK I am stupid...

    Here is the real question can I place:

    Code:
    <a href="javascript:modelesswin('http://yahoo.com',600,400)">Click here</a>
    in a flash movie that is the menu on the page?

    Will this script work or should i try somehting else
    That could work but, the entire script may need to be hard coded into the swf file. I'd try it first with the script on the page and just the above link hard coded into the swf file though.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Nov 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation

    not working John... is there any other scripts that i would be able to do because i suck at flash anf an not sure how to get all the script into the swf

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You're the one that brought up Flash. I was kind of hoping you knew how to do that. I'm just getting started with it myself. From looking over the program (Flash MX 2004) a few times, it seems that there are ways to insert various things, like javascript, images, text, formatting, etc. One just needs to know how. I also have a book on how to code this stuff but, I have yet to figure out where the two (the program and the book) meet. It is not a top priority with me but, I'm sure I will get around to, if not mastering it, at least getting to where I can do some things.

    Well, enough about me. Getting back to your original post in this thread, here is what you need to change to get it to open only onclick (addition red):

    Code:
    <script>
    
    //Modeless window script- By DynamicDrive.com
    //for full source code and terms of use
    //visit http://www.dynamicdrive.com
    
    function modelesswin(url,mwidth,mheight){
    if (document.all&&window.print) //if ie5
    eval('window.showModelessDialog(url,"","help:0;resizable:0;dialogWidth:'+mwidth+'px;dialogHeight:'+mheight+'px")')
    else
    eval('window.open(url,"","width='+mwidth+'px,height='+mheight+'px,resizable=0,scrollbars=1")')
    }
    
    //configure URL and window dimensions (width/height)
    //modelesswin("http://www.yahoo.com",840,600)
    
    //To load via link, use something like below:
    //<a href="javascript:modelesswin('http://yahoo.com',600,400)">Click here</a>
    </script>
    Then use a link like the one in the above comment*, in the body** of your page:

    HTML Code:
    <a href="javascript:modelesswin('http://yahoo.com',600,400)">Click here</a>
    * Comments in javascript start with // and are ignored (to the end of the current line) by the browser. They also can start with /* but then they need to be closed with */ and will span (once again being ignored by the browser) until the closing token is encountered.

    ** That means somewhere below the <body> tag and above the </body> tag. You know, where all of the regular HTML code goes.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •