dinbror / bpopup

bPopup is a lightweight jQuery modal popup plugin (only 1.34KB gzipped). It doesn't create or style your popup but provides you with all the logic like centering, modal overlay, events and more. It gives you a lot of opportunities to customize so it will fit your needs.
http://dinbror.dk/bPopup
427 stars 260 forks source link

auto close #6

Closed daccodac closed 11 years ago

daccodac commented 11 years ago

Hi everyone,

I would like to 'auto' close a bpopup window after 2s. Here my code

$('#popupWindow').html( 'hello world' );
$('#popupWindow').bPopup();
setTimeout(
    function(){
        $('#popupWindow').bPopup().close();
        }
    ,2000
);

The bpopup window is shown correctly, blinks avec 2s but remains on screen. :(

Thanks for your help.

dinbror commented 11 years ago

Hi daccodac.

I just tried your code and it's working just fine. I'm using jquery 1.9.1 and bpopup 0.9.3 and tested it in chrome, firefox and safari.

Do you have a live example?