Jump to content

Help!...


europeanbob
 Share

Recommended Posts

Hi,I am trying to make a map, where you first have a central image on the screen, and there are two buttons on each face of the square. One will say "pan left" (or whatever direction) and the other will say "expand map in this direction".The "pan left" button will make the map diretly to the left of the original image appear instead of it, and the "expand map in this direction" button will add an extra column or row to the map, depending on which face is clicked on.Does anyone know how this would be set up? I have all the images stored locally in separate .GIF files... theres 100 of them (10x10 map)?? I thought it could be done in a table, with 10 columns and 10 rows, where only the required ones would actually show the images?? But I dont want to preload all the images because it would take too long. ??I've read through all the tutorials and cant seem to find anything that will change the URL of the image AND prepare it for another repetition...Please Help!Thanks!

Link to comment
Share on other sites

You could compare the current map to the directed input of the user using arrays and DOM. When clicking the 'expand map' thing, you could check the corner image location, and using specific filename patterns, figure out what row/column of images is to be added.This is quite an ambitious project. Post if you need more help. :)

Link to comment
Share on other sites

You could compare the current map to the directed input of the user using arrays and DOM. When clicking the 'expand map' thing, you could check the corner image location, and using specific filename patterns, figure out what row/column of images is to be added.This is quite an ambitious project. Post if you need more help. :)

Thanks for the reply :) I have all the images named on a logical order (i.e. 0101.gif 0102.gif 0103.gif 0201.gif 0202.gif 0203.gif 0301.gif 0302.gif 0303.gif )Is there any way to actually change the URL of the image, or say the URL is file:\\c:/...../"xxyy".gif, and have some formula to work out xx and yy?
Link to comment
Share on other sites

Thanks for the reply :) I have all the images named on a logical order (i.e. 0101.gif    0102.gif    0103.gif      0201.gif    0202.gif    0203.gif      0301.gif    0302.gif    0303.gif )Is there any way to actually change the URL of the image, or say the URL is file:\\c:/...../"xxyy".gif, and have some formula to work out xx and yy?

Yes, actually it is possible to find out what xx and yy are. But you'll have to change your file names. For example, this would be one image:file:///c://....../fir11sec22.jpgThis would be to get the first and second numbers:
<script type="text/javascript">x="file:///c://....../fir11sec22.gif"y=x.split("fir")z=y[1].split("sec") //z[0] is now 11, the first number, so now refer to z[0]secZ=z[1].split(".") //secZ[0] is now 22, the second number, so refer to secZ[0]//make it easier:firNum = z[0];secNum = secZ[0];//Do the stuff</script>

And now you have seperated the numbers. :)Choco

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...