Can you wait for javascript callback?

前端 未结 9 1620
故里飘歌
故里飘歌 2020-11-29 22:21

I\'m trying to use the jQuery alerts dialog library from http://abeautifulsite.net/notebook/87 instead of the default alerts (which look pretty awful in my opinion). This se

9条回答
  •  借酒劲吻你
    2020-11-29 23:24

    This thing works. Needs jQuery.

    function myconfirm(kyssa, elm, e){ // neG
        if(jQuery('#confirmquestion').data('result')){
            var V = jQuery('#confirmquestion').data('result');
            jQuery('#confirmquestion').remove(); 
            return V == 'Y' ? true : false;         
        }else if(!jQuery('#confirmquestion').length){
            jQuery('body').append('
    '+ '

    Kinnitus

    '+ '
    '+kyssa+'
    '+ '
    '+ ' '+ '
    '+ ''); jQuery('#confirmquestion button').click(function(){ jQuery(elm).trigger(e.type); }) } return false; } onChange="if(myconfirm(\'Saada kiri: \'+jQuery(this).find(\'option:selected\').html()+\' ?\', this, event)) { ... }"

    CSS

    #confirmquestion{
        border:1px solid #999;
        background:white;
        padding-bottom: 30px;
        position:fixed;
        width:300px;
        font-size:12px;
        top:45%;
        left:50%;
        margin-left:-150px;
    }
    
    #confirmquestion h4 {
        background:blue;
        color:white;
        margin:0;
        padding: 2px 5px;
        border-bottom:#777; 
        text-align:center;
    }
    
    #confirmquestion #kyssa {
        padding: 30px 25px;
    }
    

提交回复
热议问题