Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Pop-up window


Message #1 by "Michael Conway" <mconway3@c...> on Sat, 15 Feb 2003 08:44:59
	First of all, could you make your graph-generator produce two
images, one for the graph and one for the legend ?  I suppose yes.

	Then I also suppose you know the dimension of legend image.  It
doesn't matter if you don't, you would just need to open a new window 
large
enough.

	Then somewhere in the page which displays the graph, you need
something like the following code :

<body .....>
<img src=3D"your_graph.gif">
<script language=3D"JavaScript">
<!--
 var lgdwin =3D window.open("your_legend.gif", "lgdwin",
    "width=3D100,height=3D100,status=3D0");
// -->
</script>
......
</body>

For referenc about this open() method, take a look here :
http://developer.netscape.com/docs/manuals/js/client/jsref/window.htm#12
0273
1

> -----Message d'origine-----
> De : Michael Conway [mailto:mconway3@c...]
> Envoy=C3=A9 : samedi 15 f=C3=A9vrier 2003 09:45
> =C3=80 : javascript
> Objet : [javascript] Pop-up window
>
>
> I'm new to JS.  I usually work with PHP and MySQL.  I am
> working with a
> script which graphs db data.  Works well, yet the script currently
> creates a PNG image of the graph with the legend obscuring
> some of the
> data.  I believe it would be better to open the legend in a
> separate pop-
> up that the user could open, drag and drop at will.  Rather
> than alter
> the include file that processes the data to draw the graph,
> would it be
> possible to insert a link that would open a copy of the graph
> with only
> that portion of the graph containing the legend in view (with
> the ability
> to scroll only within that portion of the image)? Or, maybe easier,
> resize the current graph to show only the legend while opening a copy 

> (without legend - which is an option)in the background?
>
> Thanks.

  Return to Index