Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Webdesign: Images

  • 03-06-2004 05: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, Registered Users 2 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, Registered Users 2 Posts: 885 ✭✭✭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