Posted By

joernroeder on 08/28/10


Tagged

jquery dialog


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

randylien


jQuery.getOrCreateDialog


 / Published in: JavaScript
 

  1. $.extend({
  2. /**
  3. * Create DialogBox by ID
  4. *
  5. * @param { String } elementID
  6. */
  7. getOrCreateDialog: function(id) {
  8.  
  9. $box = $('#' + id);
  10. if (!$box.length) {
  11. $box = $('<div id="' + id + '"><p></p></div>').hide().appendTo('body');
  12. }
  13. return $box;
  14. }
  15. });

Report this snippet  

You need to login to post a comment.