用JQuery 实现的自定义对话框

2020-05-24 21:28:48易采站长站整理

         document.documentElement.ondrag = null; 

$(document).ready(function(){ 
    $(document).find(‘[@showoption]’).each(function(){ 
        var namevalue; 
        //虽然显示的元素id,显示宽度,显示高度,标题,对话框寄居的元素对象id 
        var option={control:”,width:’400′,height:’400′,title:”,parent:null}; 
        var properties = $(this).attr(‘showoption’).split(‘;’);  
        for(i=0;i<properties.length;i++) 
        { 
            namevalue = properties[i].split(‘:’); 
            if(namevalue.length >1) 
            { 
                execute =”option.” + namevalue[0] +’=”+ namevalue[1]+’’;’; 
                eval(execute); 
            } 
        } 
        $(this).click(function(){ 
            ShowMessageBox(option); 
            document.body.focus(); 
        }); 
    });     
});