image size depends on screen resolution
kenboss
kenboss at dilbert.dnr.state.mn.us
Wed Mar 1 13:14:28 PST 2000
The book in front of me here says the screen javascript object is available in
Navigator 4 and Internet Explorer 4 (and presumably 5). It is not available in
earlier versions.
--Ken
>
> Cool. Any idea which browsers and versions of javascript this is limited to
(if any)?
>
> >>> "Peter H.M. Jacobs" <peter42 at dds.nl> 03/01/00 02:59PM >>>
> Hello,
>
> I've implemented a very small Java script for creating a mapserv image where
> the size depends on the resolution of the screen of the user. I thought that
> perhaps some of you might be interested. Just put something like this in the
> HTML template
>
> <script language=Javascript>
> <!--
> if (screen.width==800)
> {
> var imgsizex=420;
> var imgsizey=320;
> }
> if (screen.width>800)
> {
> var imgsizex=600;
> var imgsizey=480;
> }
> document.write ('<input type="hidden" name="mapsize"
> value="'+imgsizex+' '+imgsizey+'">');
> //-->
> </script>
>
> Now you've created just another hidden input type that is being send to the
> mapserv
>
> Regards,
>
> Peter
>
>
>
More information about the MapServer-users
mailing list