0

I tried using several jquery message pluggins such as alertify.

But the main thing I noticed is system message boxes halt the background functionality until user responds. Other pluggins don't have this functionality.

Is there a way to get this function to jquery pluggins? May extending native javascript objects? I cannot think a way myself.

Could you give me some idea? How can I stop current procedure until the user clicks a button?

Dan Jay
  • 874
  • 10
  • 27

2 Answers2

2

I am using jquery alert for "alert", "prompt" and "confirm" and it's really very good. I am mentioning reference URL for you.

http://runnable.com/UfNMPnKMU1ZgAACQ/how-to-create-custom-jquery-alert-confirm-and-prompt-dialogs

you can change look and feed as per your design.

Rachit Patel
  • 854
  • 5
  • 12
1

jQuery UI has some excellent samples available

You can choose to freeze the background by setting 'modal' to 'true':

$( ".selector" ).dialog({ modal: true });

jQuery will not pause any setInterval(), but you can hook up to events, so you will probably be able to stop them from executing code yourself.

Check out this working fiddle that does just that...

Reinder Wit
  • 6,490
  • 1
  • 25
  • 36
  • Will it freeze setInterval() function too? – Dan Jay Apr 25 '14 at 11:14
  • the problem is that I have several setIntervals(), if I clear them, I will be in trouble. How can I pause them when the open event triggered? – Dan Jay Apr 25 '14 at 11:44
  • 1
    In the code that executes after the interval has past, check for a global boolean value which you can set to true/false when handling the dialog. Check this answer: http://stackoverflow.com/questions/21277900/javascript-pausing-setinterval – Reinder Wit Apr 25 '14 at 11:47