Web Analytics Made Easy -
StatCounter How do I Open A new web page window using a picture (in lieu of a 'button") - CodingForum

Announcement

Collapse
No announcement yet.

How do I Open A new web page window using a picture (in lieu of a 'button")

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I Open A new web page window using a picture (in lieu of a 'button")

    I'm trying to open a new window when a picture is clicked.
    Examples I've seen have used code starting w/ <form> input="button" onclick="window.open=('abc.htm')" this creates a button that when clicked opens a new page to the desired page. I'd like to use a gif/jpeg picture and when clicked it opens a new window and the desired web page.

    My current code is below. Thanking you in advance for your help.

    john Campbell


    Click <a href="wreath.htm"> <onclick="window.open=('wreath.htm')"><img border="3" src="Eyes1.gif" width="42" height="44"></a>&nbsp;</font>
    <font color="#00FFFF" size="6">&nbsp;</font><font size="6" color="#800080">Here</font>

  • #2
    You can simply specify the target to open the page in a new window.

    <a href="wreath.htm" target="_blank"><img border="3" src="Eyes1.gif" width="42" height="44"></a>

    But if you want to open a customized window with specific size, no address bar, menubars, etc...you can use window.open
    Code:
    function openPopup(url, target){
       var w = window.open(url, target, 'width=800,height=600');
       w.focus();
       return false;
    }
    ...
    <a href="wreath.htm" target="_blank" onclick="return openPopup(this.href, this.target)">
    <img border="3" src="Eyes1.gif" width="42" height="44"></a>
    Here's the reference for the details of window features.
    Glenn
    vBulletin Mods That Rock!

    Comment

    Working...
    X