In place modal is a jquery UI widget that adds the gray backgrounds that are usually seen with modal popups. While focusing the users onto a particular element, it also keeps them in the context of the page unlike modal popups.
Checkout Ajax Machine Plugins where in-place modal is used as a plugin.
The widget creates and positions four layers(top, right, bottom ,left) so that the current element remains focussed.
inplaceModal: Creates the modal and shows it during the first call.
show: Displays the overlay by figuring out the dimensions of the target element.
hide: Hides the overlays without removing them from the DOM.
resizeOverlay: This function can be called to resize/reposition the overlay if the target element changes size/position.
No options for this widget yet. Class overlay is applied to the overlay elements.
$(function(){
$("#item11").unbind('click').bind('click', function(){
$("#list1").inplaceModal();
if($("#list1").attr("hasModal") == "true"){
$("#list1").inplaceModal('hide');
} else {
$("#list1").inplaceModal('show');
}
});
$("#item12").unbind('click').bind('click', function(){
if($("#list1").attr("hasModal") == "true"){
$("#list1").height($("#list1").height() + 5);
}
$("#list1").inplaceModal('resizeOverlay');
});
$("#item13").unbind('click').bind('click', function(){
if($("#list1").attr("hasModal") == "true"){
$("#list1").height($("#list1").height() - 5);
}
$("#list1").inplaceModal('resizeOverlay');
});
});