How to disable the Parent window while a pop-up is active?

Discussion in 'JavaScript' started by AmbilyM, Nov 20, 2007.

  1. #1
    Hi

    One of my programs in turn calls a new pop up window.
    The problem is that when the Pop up window is active I dont want any access to be possible to the parent window.It should still be visible behind the pop up window but I should not be able to work on the Parent window until the pop up is closed.

    The ShowModalDialog() functionality is working only with IE.I need a solution that works both on IE and FireFox.

    Can any one provide me with a solution which works on Firefox browser also..
     
    AmbilyM, Nov 20, 2007 IP
  2. James McMurray

    James McMurray Peon

    Messages:
    52
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Do you need a true popup window, or could you use a dhtml pseudo window?

    If you can use a fake window, you could just do something like "this.blur() {this.focus();}". That's almost certainly not the right syntax, but hopefully gets the idea across. :)
     
    James McMurray, Nov 20, 2007 IP
  3. orielo

    orielo Peon

    Messages:
    175
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i thinked of 2 ways you can solve this problem.

    the first is kind of simple,
    just creat a high zorder div on the parent window, which will cover the whole page and deny access to its underlying content.

    the second way,
    Code an event listener that will handle some action like ignoring events generated by the parent window.
    See Quiksmode's Advanced Event Registration, since im still new i cant post you the url,
    please google for it.
     
    orielo, Nov 20, 2007 IP
  4. AmbilyM

    AmbilyM Guest

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks,

    James,i need a true pop up window itself and the onblur() is of no use in mozilla
    I need a cross browser solution..

    And regarding creating a high zorder div on the parent window wil that completely hide the parent window?
    If so i dont want that to happen as in my case I need the parent window to be stil visible behind the pop up.

    Help me plz..
     
    AmbilyM, Nov 21, 2007 IP
  5. orielo

    orielo Peon

    Messages:
    175
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #5
    the div can be semi transparent, take a look at lightbox for example.
    so the page is visible, and is half transparent, so people will know its disabled.
     
    orielo, Nov 21, 2007 IP
  6. serialCoder

    serialCoder Guest

    Best Answers:
    0
    #6
    yep, i think greybox or thickbox will certainly fit your needs
     
    serialCoder, Nov 21, 2007 IP
  7. AmbilyM

    AmbilyM Guest

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Sorry,Im not able to get what you exactly said as I'm completely new to Javascript so can you please explain me what does the geybox/thickbox means.

    And also what is the lightbox example???
     
    AmbilyM, Nov 21, 2007 IP
  8. orielo

    orielo Peon

    Messages:
    175
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #8
    the lightbox, greybox, thick box are allready made scripts you will find if you type it in google
    (i cannot post links yet grrrrrrrrr)
    you can use these kind of scripts to do what you wanted.
    check them out.
     
    orielo, Nov 22, 2007 IP