This is a very quick and easy javascript function to use on images that you want to “pop-up” in the center of your page. Of course, you can also use this for popping open any new window in javascript, but I needed something specifically for opening images. Turns out it was alot easier to accomplish than I had imagined.

function launchSlides(h,w,url,title) {
var left = (screen.width – w) / 2;
var top = (screen.height – h) / 2;
var attributes = ‘height=’+h+’,width=’+w+’,top=’+top+’,left=’+left+’resizable=0′
window.open(url, title, attributes)
}

Keep in mind, you can add many other attributes… some of which are scrollbars=yes|no or resizeable=yes|no. I’m sure you can just google or koder (koders.com) something like “javascript window.open attributes” to find the basic window properties that you can adjust.

Well, that’s all for now..