Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
I have a javascript function some thing like this
Java
function func(){
............
............
var v=window.showModelDialog(url);
............// returned value in v is used here
}

In this function the execution of the function is blocked at modelDialog line and after the dialog is closed I use the returned value.

The problem is that I have to use a jquery plugin for model dialog.

I have tried some built-in plugin like facebox, fancybox or colorbox.

Using these plug-ins the execution is never stopped at there call and after the whole function is executed the pop-up is opened and the variable 'v' is always undefined.The execution is never stopped at
Java
var v=$.fn.colorbox(href: 'url');

................//v is undefined here as colorbox is not opened in the above line, it is opened after function has ended execution.

What I want is to block the execution until the pop-up is closed, have some one any idea or have knowledge of a similar built-in plugin of jquery?

I have tried already a solution that on the onClosed event of the colorbox call a function and copy past all the remaining code in that function and it works fine but I want another solution because I have to replace the showModelDialog from the whole application with a jquery plugin and it would be a tough time for me to create too much changes in the code and too much new functions. I want just one line code changes.
Posted
Updated 15-Aug-11 8:05am
v2

Do you mean one of these[^]?
 
Share this answer
 
Hi, thanx for the reply; No, first of all I have to use a built-in jquery plugin so that I can insert iFrame or can load complete page into that plus I would be able to apply css as well.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900