开发者

Pop-up dialog doesnt work within html() function

I have a div tag which will dynamically be filled with a dialog.

<div id="f2"></div>

Now,in my form submit function,i give

$("#f2").html("<a href='#noncustomer' data-rel='dialog' data-transition='pop'>Thank you for your information. You 开发者_如何学Cwill receive a call as soon as a representative is available</a>");

But, the problem is, the pop up window doesnt display. It just shows the content as a mere text..

Can someone tell me how to make the pop up appear?


Try using the facebox modal plugin http://chriswanstrath.com/facebox/


It sounds like you are in need of a simple jQuery modal plugin. You can try:

  • SimpleModal
  • jqModal

For SimpleModal, after setting the HTML for #f2, simply call the .modal() method on it and it will display the content as a modal popup:

$("#f2").html("<a href='#noncustomer' data-rel='dialog' data-transition='pop'>Thank you for your information. You will receive a call as soon as a representative is available</a>");
$("#f2").modal();

You will probably want to include the following style in your CSS to dim the background:

#simplemodal-overlay {
    background-color: black;
}

Also include the CSS class for displaying the close image detailed in the instructions:

#simplemodal-container a.modalCloseImg {
    background:url(/img/x.png) no-repeat; /* adjust url as required */
    ...
}

Hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜