Code:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<a href="#" rel='pop-up'>click me</a>
</div>
<script type="text/javascript">
$(document).ready(function() {
$("a[rel='pop-up']").click(function () {
if($(this).attr("target")!=="_blank") {
var pop_w = '650';
var pop_h = (typeof $(this).attr("data-height") !== "undefined") ? $(this).attr("data-height") : '350';
var pop_left = (screen.width/2)-(pop_w/2);
var pop_top = (screen.height/2)-(pop_h/2);
var settings = "height="+pop_h+", width="+pop_w+", scrollTo, resizable=0, scrollbars=0, location=0, top="+pop_top+", left="+pop_left;
window.open(this.href, 'Popup', settings);
return false;
}
});
});
</script>
</body>
</html>