VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 12[3] ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 08:01:45 02/17/00 Thu
Author: Webmaster
Subject: Re: How come this script can't be run in IE??
In reply to: SweetHeart 's message, "Re: How come this script can't be run in IE??" on 20:32:58 02/14/00 Mon

Hi SweetHeart,

Sorry for my late reply. I've written an example for you.

Demonstration:
<a rel=nofollow target=_blank href="http://home4u.hongkong.com/_H4U/entertainment/music/mpx/js/map/map.htm">http://home4u.hongkong.com/_H4U/entertainment/music/mpx/js/map/map.htm</a>

Download:
<a rel=nofollow target=_blank href="http://home4u.hongkong.com/_H4U/entertainment/music/mpx/js/map/map.zip">http://home4u.hongkong.com/_H4U/entertainment/music/mpx/js/map/map.zip</a>

I think the best way to do this is to use Dynamic HTML (DHTML), though it runs in IE4+ or NN4+ only.

The page has a drop-down list and a map image. You can select a place in the list and then press the submit button. The image will shift and the place will be located at approximatly the center of the document area.

Settings:
1) Image source:

<img src="jpmap.gif">

2) Image size:

<div id="map" style="position:relative; zIndex:-1; width:510; height:441; left:0; top:0">

You can modify the "width:510; height:441" by filling the size of your image.

3) Choice of places:

<select name="place" size="1">
<option value="KANTO">KANTO</option>
<option value="HOKKAIDO">HOKKAIDO</option>
<option value="KYUSHU">KYUSHU</option>
</select>

You can add more places in this list.

4) Place coordinates:

var placex = new Array(325, 430, 92)[placeid];
var placey = new Array(245, 75, 262)[placeid];

"placex" and "placey" are the x and y coordinates in pixel, respectively. You can use a graphics software to open your image file to get the coordinates. The index of the two arrays corresponses to the "selectedIndex" property of drop-down list. For example, KANTO is the first option so it is at (325,245). HOKKAIDO is the second option so it is at (430,75).

Hope this helps and thank you for your visit.


> Dear webmaster:
> Thank you very much! the last problem has been sovled.
> and now comes out another problem i want to ask your
> help.I have a map loaded,that is a .jpg file ,I need
> to locate a place which i have selected in select form
> to the center of the screen.For example,when i choose
> Astreet, the detail of Astreet 's map should be shown
> in the center of the screen. I have no idea how to
> scroll the picture by matching the text of the jpg
> file.Hope you can give me some help to figure it out.
> Thanks a lot!!

[ Next Thread | Previous Thread | Next Message | Previous Message ]


Replies:


[ Contact Forum Admin ]


Forum timezone: GMT-8
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.