百度的popup的弹出框

使用的方法

/**
 * 弹出alert
 * @param title
 * @param content
 * @param w
 * @param h
 */
function showAlert(title, content, w, h) {
    var pop = new Popup({
        contentType: 4,
        isReloadOnClose: false,
        width: w,
        height: h
    });
    pop.setContent("title", title);
    pop.setContent("alertCon", content);
    pop.build();
    pop.show()
}
 //通过popup.js打开模态对话框
var popp;
function ShowIframe(t,url, w, h) //显示有滚动条的iframe
{
    var pop = new Popup({
        contentType: 1,
        scrollType: 'yes',
        isReloadOnClose: false,
        width: w,
        height: h
    });
    pop.setContent("contentUrl", url);
    pop.setContent("title", t);
    pop.build();
    pop.show();
    popp = pop;
}

function ShowIframeNoScroll(t,url, w, h) //显示没有滚动条的iframe
{
    var pop = new Popup({
        contentType: 1,
        scrollType: 'no',
        isReloadOnClose: false,
        width: w,
        height: h
    });
    pop.setContent("contentUrl", url);
    pop.setContent("title", t);
    pop.build();
    pop.show();
    popp = pop;
}




//父页面关闭popup
function ClosePop() {
    popp.close();
}
//调用父页面关闭popup方法
function closeWin() {
    parent.ClosePop();
}


function showMessageBox(title,mess){
    var strHtml = "<table class='style_no' width='100%' height='80' border='0' cellpadding='0' cellspacing='0' bgcolor='#FFFFFF'><tr><td><div id='show' style=' margin:auto; text-align:center; font-size: 14px'>" + mess + "</div></td></tr></table>";
    g_pop = new Popup({ contentType:2,isReloadOnClose:false,width:340,height:80});
    g_pop.setContent("title",title);
    g_pop.setContent("contentHtml",strHtml);
    g_pop.build();
    g_pop.show();
}

/**
 * 弹窗
 *
 * @param title 页面标题
 * @param url 路径
 * @param width 宽度
 * @param height 高度
 */
var g_pop;
function popupClose(){
	if(g_pop != null) {
		g_pop.close();
	}
}
function showPopup(title,url,width,height){
    g_pop = new Popup({ contentType:1,showCloseButton:true,isReloadOnClose:true,width:width,height:height});
    g_pop.setContent("title",title);
    g_pop.setContent("contentUrl",url);
    g_pop.build();
    g_pop.show();
}

function showPopupNoReload(title,url,width,height){
    g_pop = new Popup({ contentType:1,showCloseButton:true,isReloadOnClose:false,width:width,height:height});
    g_pop.setContent("title",title);
    g_pop.setContent("contentUrl",url);
    g_pop.build();
    g_pop.show();
}

 

 

 

转载自:https://blog.csdn.net/hqmln/article/details/84527471

You may also like...