On Jul 22, 8:50 pm, Chris <[email protected]> wrote:
>
> Here is my code exemple:
> The Thumbnail is "img src="250150.jpg" and by clicking this image a
> bigger window where a larger picture is in should open.

I'll give some hints, but they are only hints because I can't be
bothered to look up the exact details. I'm sure you can do that.

I'm going to assume that the big picture is called "A.jpg". You can
use any name, of course.

Any HTML element can have a click handler attached to it, so you can
add an onclick attribute to your thumbnail:

   var marker = createMarker(point,'Exemple <br> <img
   src="250150.jpg" width=250 height=150
   onclick="showLarge(\'A.jpg\')">...')

Note the \ in there so that you get three levels of quote characters.
Look up "escape characters" if you're not familiar with that. That
should all be one line, of course: the Groups interface likes to break
up long lines.

What that line does is get Javascript to call a function called
showLarge() when the thumbnail is clicked. So now you need to define
that function, which must be in global scope -- not enclosed in any
other function -- to work properly.

    function showLarge(pic) {
      window.open(pic)
      }

When the thumbnail is clicked, showLarge is run with 'A.jpg' passed to
it. Within the function, its local variable pic holds 'A.jpg' and then
another window is opened with that as the URL loaded.

To do: (a) look up window.open() and make sure that you pass the url
correctly and set options like the address bar, size and so on. Just
writing window.open(pic) will almost certainly need some tweaking. (b)
Make sure that whatever you pass in -- A.jpg in this example -- is a
valid URL. You may need an absolute URL which starts with http:, you
may not.

If you run into any difficulties, feel free to repost, but DON'T post
code. Post a link so the Group can see where you're at and how things
don't work. If you have a single page with all your HTML and
Javascript in the one file, you could upload it to the Files section
here if you have no other hosting.

Andrew
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to