jquerypopupjqmodal

Fading in / out my popup?


I'm using jqModal and it does everything I want to, however I want to add a fade effect for showing and hiding the popup, it currently just shows and hides and I find it a bit too sudden. The problem is I have tried everything to get it to fade in but I am having no luck whatsoever.

Can you help me achieve this? Even if it's some kind of alternative solution :)

$('.trigger').click(function(){
   $('.jqmWindow').jqm({ ajax:'people'});
   $('.jqmWindow').jqmShow();
});

$('.jqmWindow').on('click', '.close', function(){
   $('.jqmWindow').jqmHide();
});

Solution

  • how about this:

    var myFadeIn=function(hash){
        hash.w.fadeIn("2000");
    };
    
    var myFadeOut=function(hash){
        hash.w.fadeOut("2000",function(){
            hash.o.remove(); 
        });
    };
    
    $('.trigger').click(function(){
        $('.jqmWindow').jqm({
            ajax:'people',
            onShow:myFadeIn,
            onHide:myFadeOut
        });
        $('.jqmWindow').jqmShow();
    });
    
    $('.jqmWindow').on('click', '.close', function(){
        $('.jqmWindow').jqmHide();
    });