Page 1 of 1

onclick script help

Posted: Tue 23 Sep 2014 5:57 am
by Michael_Wright
good afternoon I am trying to get the image to zoom in and out like on an onclick but still now working could someone help me out please mike

Code: Select all

<table width="100%" border="0" cellpadding="0"align="centre">
  <tr>
    <th>winds 1000 hpa</th>
    <th>winds at 850 hPa</th>
    <th>Jetstream winds <th>
</tr>
  <tr> 
</td>
<a href="windmaps.htm" target="wind"><img border="1" src="http://earth.nullschool.net/#current/wind/isobaric/1000hPa/equirectangular" alt=""></a>
 <a onclick="window.open(http://earth.nullschool.net/#current/wind/isobaric/1000hPa/equirectangular);return false;" href="windmaps.htm" target="winds"><img border="0" src="http://earth.nullschool.net/#current/wind/isobaric/1000hPa/equirectangular" alt=""></a>
 </tr> 
  </table>  

Re: onclick script help

Posted: Tue 23 Sep 2014 12:20 pm
by beteljuice
You seem to be trying two different ways of opening a new window, but both are incomplete and you don't say if you have two different size images or you are using css / html to resize.

Code: Select all

// case #1
<a href="windmaps.htm" target="wind"><img border="1" src="http://earth.nullschool.net/#current/wind/isobaric/1000hPa/equirectangular" alt=""></a>
// there isn't actually a picture, the url is incomplete and you haven't 'defined' the size.
// It is assumed that new window windmaps.htm contains the full sized image.

// case #2
// very similar problems
<a onclick="window.open(http://earth.nullschool.net/#current/wind/isobaric/1000hPa/equirectangular);return false;" href="windmaps.htm" target="winds"><img border="0" src="http://earth.nullschool.net/#current/wind/isobaric/1000hPa/equirectangular" alt=""></a>
// with the added hook that the href and target are irrelevent because of return false;
There are many 'pretty' ways to display a picture in a <div> on the current page (think like google picuture search) but let's go with ye olde basics a' la case #1 assuming you only have one sized version of the image.

Code: Select all

<a href="windmaps.htm" target="wind"><img border="1" src="http://link_to_your_img.jpg" alt="Click for large version" title="Click for large version" style="width: small_widthpx; height: small_heightpx;" /></a>
// the 'problem' with this technique is that they have already downloaded the large image.

Re: onclick script help

Posted: Tue 23 Sep 2014 12:29 pm
by mcrossley
Isn't a more basic problem that "http://earth.nullschool.net/#current/wi ... ectangular" isn't an image but a fully interactive page.

I put it in an iframe on my page.

Re: onclick script help

Posted: Tue 23 Sep 2014 1:38 pm
by beteljuice
I didn't bother chasing the link. I just assumed it was a malformed url. - naughty beteljuice :lol: