Help with border around image

Discussion in 'Javascript' started by Keith Smith, May 11, 2005.

  1. Keith Smith

    Keith Smith Guest

    When I use this code....

    window.open('gallery/pic1.jpg','windowname','width=775,height=550,resizable=yes,scrollbars=yes,top=10,left=10');

    ....my web page displays a picture with a white border around it. Is there a
    way to get rid of the white border? I want to continue to link directly to
    my image (pic1.jpg) and not to an HTML page. The reason for this is because
    if I link directly to an HTML page then I seem to have problems with pop-up
    blockers.

    Anyone know how to get rid of the white around the pic?
    Keith Smith, May 11, 2005
    #1
    1. Advertising

  2. Keith Smith

    RobB Guest

    Keith Smith wrote:
    > When I use this code....
    >
    >

    window.open('gallery/pic1.jpg','windowname','width=775,height=550,resizable=yes,scrollbars=yes,top=10,left=10');
    >
    > ...my web page displays a picture with a white border around it. Is

    there a
    > way to get rid of the white border? I want to continue to link

    directly to
    > my image (pic1.jpg) and not to an HTML page. The reason for this is

    because
    > if I link directly to an HTML page then I seem to have problems with

    pop-up
    > blockers.
    >
    > Anyone know how to get rid of the white around the pic?


    You may have problems with blockers regardless.

    <a href="gallery/pic1.jpg"
    target="picpop"
    title="whatever"
    onclick="return openpic(this,775,550)">show pic</a>
    ...........
    ...........
    function openpic(link, w, h)
    {
    window.HTML = [
    '<body style="margin:0;background:black;' ,
    'cursor:pointer;" ' ,
    'title="click to close" ' ,
    'onload=document.title="'+link.title+'" ' ,
    'onblur="top.close()" ' ,
    'onclick="top.close()">' ,
    '<img src="' + link.href + '" ',
    'style="width:'+w+'px;height:'+h+'px;' ,
    'border-width:0;"></body>'
    ].join('');
    picpop = window.open(
    'javascript:eek:pener.HTML',
    link.target,
    'width='+w+',height='+h+',top=10,left=10'
    );
    if (picpop.focus)
    picpop.focus();
    return false;
    }
    RobB, May 11, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tshad
    Replies:
    0
    Views:
    2,236
    tshad
    Jan 31, 2005
  2. Kian
    Replies:
    18
    Views:
    67,534
    SickHabitz
    Nov 27, 2012
  3. phl
    Replies:
    1
    Views:
    4,324
    Martin Jay
    Jun 8, 2006
  4. Coder
    Replies:
    1
    Views:
    680
    Cowboy \(Gregory A. Beamer\)
    Jun 24, 2006
  5. Kevin Audleman

    Getting rid of border around image

    Kevin Audleman, Feb 10, 2008, in forum: HTML
    Replies:
    12
    Views:
    3,313
    Jonathan N. Little
    Feb 13, 2008
Loading...

Share This Page