I’ve got a popup working with jQuery but it is rendering at the same place as the DIV. I’d like the popup to render in the middle of the page. Is it possible? If yes, then how?
My CSS:
.newpopup {
display:none;
border: 1px solid black;
background-color: #eee;
}
HTML:
<div class='newpopup'>
</div>
<button>popup</button>
JavaScript:
function popup() {
alert('test');
var popup = $('.newpopup');
popup.draggable();
popup.resizable();
popup.html('<p>Where is pancakes house?</p>');
popup.show('fast');
}
$(document).ready(function(){
$('button').click(function(){
popup();
});
})
Set your popup css
position : absoluteand usetop & leftproperties to set your popup position.EDIT
I created a fiddle , Jsfiddle it works perfectly here, check it out.