Question: Trying to find the best way of create an overlap/overlay layer to fill the screen .. and then create a new layer on top on load in some html...

```
// Show popup - somehting like this..
$("#myBtn").click(function() {
    $("#myDiv").load("myHTMLcode.html");
});

```

and then i need a way of remove it 

Any ideas, is there an easy way of doing this, its similar to the modal form except i wish to load in html rather than show a form..

Answer: 
I'm reasonably certain that you could do this with the [dialog](http://docs.jquery.com/UI/API/1.7/Dialog) widget from jQuery UI. Use the open event handler hook to provide a way to drop your HTML into the dialog container when the dialog is opened.

```
$('#dialogDiv').dialog({
    modal: true,
    autoOpen: false,
    buttons: { "Ok": function() { $(this).dialog("close"); },
    open: function(event,ui) {
             $(ui).find('#container').load( ... );
          }
});

$('#openButton').click( function() {
   $('#dialogdDiv').dialog('open');
});

```

If the url needs to be supplied, consider using `data()`

```
$('#openButton').click( function() {
   $('#dialogdDiv').data('url','someurl').dialog('open');
});

open: function(event,ui) {
         $(ui).find('#container').load( $('#dialogDiv').data('url') );
      }

```
$("#myDiv").html('');