Results 1 to 9 of 9

Thread: Need help opening DHTML Window widget into other frame

  1. #1
    Join Date
    Jun 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Need help opening DHTML Window widget into other frame

    1) Script Title: DHTML Window widget (v1.03)

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

    3) Describe problem: Trying to launch window from one frame to appear in another

    My site is designed in the following manner-

    index.html has frames which point to top.html and main.html
    thus on loading, the browser displays the following--

    ------------------
    | top window
    |----------------
    |
    | main window
    |
    |______________

    when i reference the windows from one another with an <A> statement, I use target="main" for the main page. My problem is, the link that I want to use to launch the DHTML window is in the TOP WINDOW, but it uses an ONCLICK to launch so i cannot get it to launch the window inside the MAIN window. Does anyone know a way to accomplish this? Thanks for the help!

  2. #2
    Join Date
    Aug 2004
    Posts
    9,918
    Thanks
    3
    Thanked 969 Times in 957 Posts
    Blog Entries
    15

    Default

    Instead of something like:

    Code:
    <a href="#" onClick="yahoowin=dhtmlwindow.open('yahoo', 'iframe', 'http://yahoo.com', 'Yahoo', 'width=500px,height=300px,center=1'); return false">Show Yahoo</a>
    Try:

    Code:
    <a href="#" onClick="yahoowin=parent.mainwin.dhtmlwindow.open('yahoo', 'iframe', 'http://yahoo.com', 'Yahoo', 'width=500px,height=300px,center=1'); return false">Show Yahoo</a>
    Make sure all the DHTML window files are installed inside the Main Window page (not the top frame). All the above code does is try and call the dhtmlwindow() function that is inside the main window (versus the current frame, or top window). I haven't tested this yet, though it should work.

  3. #3
    Join Date
    Jun 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    by MAIN WINDOW PAGE, do you mean the INDEX.HTML file that contains the FRAMESETS or the MAIN.HTML that i want the window to pop up in?

  4. #4
    Join Date
    Aug 2004
    Posts
    9,918
    Thanks
    3
    Thanked 969 Times in 957 Posts
    Blog Entries
    15

    Default

    Main window page as in the page that is contained inside the "Main" frame. For example:

    Code:
    <html>
    <frameset rows="50&#37;,50%">
    <frame name="topwin" src="page1.htm">
    <frame name="mainwin" src="page2.htm">
    </frameset>
    </html>
    So I'm referring to "page2.htm", which is btw accessed via the "mainwin" name assigned to its frame.

  5. #5
    Join Date
    Jun 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    OK, I tried the following..

    I put this link into the TOP.HTML (name=top)

    <a href="#" onClick="divwin=parent.main.dhtmlwindow.open('divbox', 'div','somediv', '#4: DIV Window Title', 'width=450px,height=300px,left=200px,top=150px,resize=1,scrolling=1'); return false" target=main></a>



    i put the following two lines into the MAIN.HTML (name=main) but NOT in the TOP.HTML

    <link rel="stylesheet" href="dhtmlwindow.css" type="text/css" />
    <script type="text/javascript" src="dhtmlwindow.js"></script>



    I put the <DIV> being used in the MAIN.HTML file

    <div id="somediv" style="display:none">
    <p style="height: 400px">This is some content within a DIV, shown inside this window instead</p>
    </div>

    however, all I get is the TOP.HTML file being opened into the main window, no DHTML window popping up at all. If i take out the target="main" from the <A>, i don't get anything.

  6. #6
    Join Date
    Aug 2004
    Posts
    9,918
    Thanks
    3
    Thanked 969 Times in 957 Posts
    Blog Entries
    15

    Default

    Two questions:

    1) Is your "main window" frame named "main"? For example:

    Code:
    <html>
    <frameset rows="50&#37;,50%">
    <frame name="topwin" src="page1.htm">
    <frame name="main" src="page2.htm">
    </frameset>
    </html>
    2) Inside "main.html", did you include the entire DHTML window widget script and file references in its HTML?

  7. #7
    Join Date
    Jun 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yes, the frame "main" is MAIN.HTML.

    The only code that I put in the MAIN.HTML file was the following -

    <link rel="stylesheet" href="windowfiles/dhtmlwindow.css" type="text/css" />

    <script type="text/javascript" src="windowfiles/dhtmlwindow.js">



    I've tested the code by just putting those lines into the TOP.HTML file along with the link and it worked ok that way.

  8. #8
    Join Date
    Aug 2004
    Posts
    9,918
    Thanks
    3
    Thanked 969 Times in 957 Posts
    Blog Entries
    15

    Default

    Do you happen to have the test pages online? It would definitely make it easier for me to see where the problem is that way...

  9. #9
    Join Date
    Jun 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your help ddadmin, I figured out the problem.

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
  •