Help to close a jQuery Modal box window

Discussion in 'JavaScript' started by kajol, Sep 18, 2011.

  1. #1
    Hi,

    I am using a jQuery modal box to show a status. I want to close the modal (not dialog) box after x seconds. Please help me on this.


    Thanks in advance
     
    kajol, Sep 18, 2011 IP
  2. JohnnySchultz

    JohnnySchultz Peon

    Messages:
    277
    Likes Received:
    4
    Best Answers:
    7
    Trophy Points:
    0
    #2
    try this...

    
    
    $("#id").dialog('open');
    
    setTimeout(function(){ $("#id").dialog('close'); },5000); // 5000 is 5 seconds
    
    
    Code (markup):
     
    JohnnySchultz, Sep 19, 2011 IP
  3. akumar2

    akumar2 Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    correct.. use setTimeout function :)
     
    akumar2, Sep 20, 2011 IP