简体   繁体   English

如何在window.open中使用颜色框

[英]How to use colorbox in window.open

i have this popup function using javascript 我有使用JavaScript的弹出功能

 function BookingIDCancellation() {

        window.open("popup/BookingIDCancellation.aspx?field=BookingID|<%=txtBookingID.clientid%>", "mywindow", "menubar=0,resizable=1,scrollbars=1,width=500,height=450")

    }

i use this function on button so that it will popup after clicking on it and get value from the popup page. 我在按钮上使用此功能,以便在单击它后将其弹出并从弹出页面获取价值。

<asp:Button ID="btnBrowse" CssClass="button" runat="server" Text="Browse" OnClientClick="BookingIDCancellation();return false;" />

How to use this window.open with jquery colorbox so that the popup window will look nicer? 如何使用带有jQuery colorbox的window.open,以便弹出窗口看起来更好?

You can use the code below: 您可以使用以下代码:

function BookingIDCancellation(){
     $.colorbox({href:"popup/BookingIDCancellation.aspx?field=BookingID|<%=txtBookingID.clientid%>", width:"500px", height:"450px"});
}

Please note that if "BookingIDCancellation.aspx" contains Postback functions you need to add the "iframe:true" paramater to the $.colorbox function, and you need to set the Postback URL in the "BookingIDCancellation.aspx" page. 请注意,如果“ BookingIDCancellation.aspx”包含回发功能,则需要在$ .colorbox函数中添加“ iframe:true”参数,并且需要在“ BookingIDCancellation.aspx”页面中设置回发URL。

iFrame code: iFrame代码:

function BookingIDCancellation(){
     $.colorbox({href:"popup/BookingIDCancellation.aspx?field=BookingID|<%=txtBookingID.clientid%>", width:"500px", height:"450px", iframe:true});
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM