4 Replies - 1067 Views - Last Post: 17 January 2010 - 09:19 PM

#1 nick1200  Icon User is offline

  • Php Coder
  • member icon

Reputation: -19
  • View blog
  • Posts: 922
  • Joined: 21-March 09

A New Browser Window

Post icon  Posted 30 December 2009 - 08:42 AM

i have this code to open a new window


<FORM>
<INPUT type="button" value="New Window!" onclick="window.open('http://www.mysite.com.indec.html','mywindow','width=400,height=200,toolbar=yes,
location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,
resizable=yes')">
</FORM> 




this works just the way i want it
but now i want to add a image so when the image is clicked it opens a new window that is 400 in hegight and 200 in w

so i cant just normal link it

my image
src="<?php echo $row['poke1pic'] ?>" width="56" height="55" /><br>




i have this now


td class="headings"><center><a href="java script:;" onclick='java script:window.open("index.html","Pokemon_Stats","toolbar=no,height=420px,width=200px");'></a><img src="<?php echo $row['poke1pic'] ?>" width="56" height="55" /><br>




Which don't work it wont let me click on the image

Is This A Good Question/Topic? 0
  • +

Replies To: A New Browser Window

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1642
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: A New Browser Window

Posted 30 December 2009 - 08:55 AM

Just so you know Javascript is not Java, they're 2 completely different languages. Moved to Javascript :)
Was This Post Helpful? 0
  • +
  • -

#3 nick1200  Icon User is offline

  • Php Coder
  • member icon

Reputation: -19
  • View blog
  • Posts: 922
  • Joined: 21-March 09

Re: A New Browser Window

Posted 30 December 2009 - 08:58 AM

View PostPsychoCoder, on 30 Dec, 2009 - 07:55 AM, said:

Just so you know Javascript is not Java, they're 2 completely different languages. Moved to Javascript :)


ya i couldn't find java script ;)
Was This Post Helpful? 0
  • +
  • -

#4 moonoo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 28-December 09

Re: A New Browser Window

Posted 04 January 2010 - 01:51 PM

Have you tried to wrap the opening in a function then call from image?

e.g.

function openSesame(){
//your open window code here
}

HTML

<img src="xxxxxxx" onclick="openSesame()">
Was This Post Helpful? 0
  • +
  • -

#5 psyking  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 20
  • View blog
  • Posts: 165
  • Joined: 17-January 10

Re: A New Browser Window

Posted 17 January 2010 - 09:19 PM

You could try something like this:
//This causes a link that opens a new window:
<a href="java script:window.open('http://www.yoursite.com/index.html','mywindow','width=400,height=200,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes')">
//This is the image, which becomes a link:
<img src="your_image" />
//This ends the link:
</a>

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1