Thank you for your vote. Please wait...
It appears you already voted for this snippet
It appears your vote value was empty
<script type="text/javascript">
function LoadPhoto(the_href) {
var centerWidth = (window.screen.width - 630) / 2;
var centerHeight = (window.screen.height - 420) / 2;
var w = window.open('', 'Photo', 'width=630,height=420,left=' + centerWidth + ',top=' + centerHeight );
w.document.writeln("<HTML><HEAD>");
w.document.writeln("<TITLE>" + the_href + "</TITLE>");
w.document.writeln("<STYLE> BODY { margin-left: 0; margin-top: 0 } </STYLE>");
w.document.writeln("</HEAD><BODY><a href='javascript:self.close();'><img");
w.document.writeln("src='" + the_href + "'");
w.document.writeln("onMouseOver='window.status='click image To Close this window'; Return True;'");
w.document.writeln("onMouseOut='window.status='';'");
w.document.writeln("border-0 width=630 height=420");
w.document.writeln("alt='click image to close this window'");
w.document.writeln("title='click image to close this window'");
w.document.writeln("></a>");
w.document.writeln("</BODY></HTML>");
w.document.close();
w.focus();
}
</script>
<!---Body--->
// call it like this
<a href="javascript:LoadPhoto('images/image1.jpg')">View image</a>
Does not work. Under Windows Internet Explorer 8, the script section is flagged with a message indicating a parenthesis is missing on the following line of code:
w.document.writeln("onMouseOver="window.status='click image To Close this window'; Return True;"");
I found the problem and it should now work fine.
Hi there,
This a very a very good script for a borderless window. i have tried however to add some code in order to center it on the screen but I've had no luck until now. Could you post some code for centering it in the browser window?
I have added some code to center the window. Just change the numbers to match the size of your image
Adding your comment. Please wait...
Thanks for adding your comment!. After further review it will be added.
There was a problem adding your comment. Please try again.
Please complete all the fields in the form before sending.