Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Webdesign: Images

Options
  • 03-06-2004 5:50pm
    #1
    Banned (with Prison Access) Posts: 5,154 ✭✭✭


    Hi folks,
    Before attempt to tread thought the mountains of crap on the interweb to find an answer:
    I want to open images (when the user clicks on the link) in a new window with no toolbars, buttons or anything like that - just the image in the window.

    What's the simplest way to go about doing this?

    Thanks,
    S.


Comments

  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    I've done somthing similar here. Looks a bit dated now but the code works.


  • Closed Accounts Posts: 1,819 ✭✭✭K!LL!@N


    Maybe something like this?


    <SCRIPT LANGUAGE="JavaScript" type="text/javascript">

    var mypopup=null;

    function popup(URL, winW, winH)
    {
    if ( mypopup && !mypopup.closed )
    {
    mypopup.close();
    }

    mypopup = window.open(URL, "Pic", 'scrollbars=0, menubar=0, resizable=0, toolbar=0, status=0, left=0, top=0, width=' + winW + ', height=' + winH);
    mypopup.document.write('<body bgcolor="#000000" leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>');
    mypopup.document.write('<img src="' + URL + '" border="0">');
    mypopup.document.write('</body>');
    }
    </SCRIPT>


    Use as follows:

    <a href="javascript:popup('./images/gallery/1.jpg','640','480')"><img src="images/gallery/T1.jpg" width="160" height="120" border="0"></a>

    the smiley face is : p no space


    Killian


  • Registered Users Posts: 880 ✭✭✭clearz


    Instead of passing the width and height into that function you could just pass the path of the image in then use an Image object to get the width and height. That way any image can be easily used without first known its dimentions.


Advertisement