DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: window.open - Maximizing the "Target"

  1. #1
    JZ Guest

    window.open - Maximizing the "Target"

    Hello,

    I am using the following Vbscript code when clicking a link on a a page to
    open a new window. I use the same "Target" with all of the links to ensure
    that if the user does not close the new window, it will be re-used for the
    other links. The only problem is that the code below ensures that the "link
    window" will be maximized when the user clicks on another link (if the
    window stayed open but was minimized) but it does not necessarily bring the
    "link window" to the front. Does anyone know how to bring the "link window"
    to the front?

    Thanks in advance,
    J.

    ********************************************************************
    Function OpenLink(strURL, intWidth, intHeight)

    Dim strFeatures
    Dim intTop, intLeft
    Dim objWindow

    'Make sure the new window is centered
    intLeft = (screen.AvailWidth - intWidth) \ 2
    intTop = (screen.AvailHeight - intHeight) \ 2
    strFeatures = "top=" & intTop & "px" _
    & ",left=" & intLeft & "px" _
    & ",width=" & intWidth & "px" _
    & ",height=" & intHeight & "px" _
    & ",menubar=no, directories=no, scrollbars=yes,
    status=yes, resizable=yes"

    Set objWindow = window.open (strURL, "InventoryInquiryChild", strFeatures)
    objWindow.focus

    End Function





  2. #2
    Bronwyn Streeter Guest

    Re: window.open - Maximizing the "Target"

    This is how I've done it. Essentially if it is already open you close it
    and then re-open it. It will re-open on top. It works in all browsers as
    well.

    <A HREF="glossary" onClick="Glossary('salary');return false;">Blah</A>
    <SCRIPT LANGUAGE=Javascript>
    var win=null
    function Glossary(handle) {
    if (win && win.open) {
    win.close();
    openGlossary(handle);
    }
    else {
    openGlossary(handle);
    }
    }

    function openGlossary(link) {
    var winHEIGHT=400
    var winWIDTH=500
    win = window.open('glossaries/salary.htm' + link,
    'Glossary','resizable,height=' + winHEIGHT + ',width=' + winWIDTH +
    ',scrollbars=yes,alwaysRaised=yes');
    }
    </SCRIPT>

    JZ <jonathanzack@hotmail.com> wrote in message
    news:3b545e9e@news.devx.com...
    Hello,

    I am using the following Vbscript code when clicking a link on a a page to
    open a new window. I use the same "Target" with all of the links to ensure
    that if the user does not close the new window, it will be re-used for the
    other links. The only problem is that the code below ensures that the "link
    window" will be maximized when the user clicks on another link (if the
    window stayed open but was minimized) but it does not necessarily bring the
    "link window" to the front. Does anyone know how to bring the "link window"
    to the front?

    Thanks in advance,
    J.

    ********************************************************************
    Function OpenLink(strURL, intWidth, intHeight)

    Dim strFeatures
    Dim intTop, intLeft
    Dim objWindow

    'Make sure the new window is centered
    intLeft = (screen.AvailWidth - intWidth) \ 2
    intTop = (screen.AvailHeight - intHeight) \ 2
    strFeatures = "top=" & intTop & "px" _
    & ",left=" & intLeft & "px" _
    & ",width=" & intWidth & "px" _
    & ",height=" & intHeight & "px" _
    & ",menubar=no, directories=no, scrollbars=yes,
    status=yes, resizable=yes"

    Set objWindow = window.open (strURL, "InventoryInquiryChild", strFeatures)
    objWindow.focus

    End Function







Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center