Results 1 to 2 of 2

Thread: Help to resize image to fullscreen

  1. #1

    Help to resize image to fullscreen

    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

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

    Code:
    <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>

  2. #2
    there are a few msitakes in your code:

    +" <script>

    should be
    +" <script> "

    and

    +" </script>"
    somehow and i'm not shure why dis has to be

    +"<\/script> "

    One tip: first try it out in plain html call the function from a javascript and it's much easier to debug

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012