# Help to resize image to fullscreen

**URL:** <https://forum.kirupa.com/t/help-to-resize-image-to-fullscreen/217090>\
**Category:** web dev\
**Created:** [February 22, 2007, 10:59pm UTC](https://forum.kirupa.com/t/help-to-resize-image-to-fullscreen/217090 "2007-02-22T22:59:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![keksas](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/keksas/32/3122_2.png) [@keksas](https://forum.kirupa.com/u/keksas)\
**Post date:** [February 22, 2007, 10:59pm UTC](https://forum.kirupa.com/t/help-to-resize-image-to-fullscreen/217090/1 "2007-02-22T22:59:36Z")

</div>

Hello. I’ve found how to do this, but o can’t do it properly 😕 My code doesn’t work, because if i put \</script\> ir another script it finishes the first. Can you help me with this? Or maybe you could tell how to do it in different way?

My code:

AS

```auto
fullscreen_mc.onRelease = function() {
    getURL('javascript:display("1.jpg")');
};

```

Javascript

```auto
<script type="text/javascript" language="javascript">
function display(myimage) {
    html = "<html>"
+" <head>"
+" <script>
+" function filler() {"
+" browseHeight=document.body.clientHeight;"
+" document.fred.height = browseHeight-100;"
+" }"
+" </script>"
+" </head>"
+" <body bgcolor='#000000' onload='filler()'>"
+" <table width=100% height=100%><tr>"
+" <td align=center>"
+" <img src="+myimage+" name='fred' height=600><br><br>"
+" <a href='javascript:window.close();'><font face='verdana' size='2' color='#222222'>Close</font></a>"
+" </table>"
+" </body>"
+" </html>"
+"}"
popup = window.open("","image","toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0");
popup.moveTo(0,0);
popup.resizeTo(screen.width, screen.height);
popup.document.open();
popup.document.write(html);
popup.document.focus();
popup.document.close();
};
</script>

```
