Mike Williams has a tutorial on something called closure which you
might find useful
, basically for your point variable to have a set value when that
mousover is called it either
has to have been created with closure (say in a function which creates
your listiemLink
or you have to have a global variable you are referencing or less
pretty you could also define the mouseover
the same way you are doing your innerHTML ...as a string)
On Nov 3, 9:51 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hi again :-)
>
> Yeah, I've got that section of the code looking like:
>
> -----
> for (i=0; i<area.length; i++) {
>
> var listItem =
> document.createElement('li');
> var listItemLink =
> listItem.appendChild(document.createElement('a'));
> var latitude = area[i].lat;
> var longitude = area[i].lng;
> var point = new
> GLatLng(latitude,longitude);
>
> listItemLink.innerHTML = '<img
> src="images/maps/' + area[i].flag
> + '">' + area[i].country + point;
> listItemLink.className =
> 'countryLink';
>
>
> document.getElementById('sidebar-list').appendChild(listItem);
>
> listItemLink.onmouseover =
> function(){map.panTo(point); };
>
> }
> -----
>
> But it still yields the same result. It's the same if I put the
> listItemLink.onmouseover... line after the bracket.
>
> Thanks for all your help so far.
>
> Tom
>
> On Nov 3, 2:42 pm, Mike Williams <[EMAIL PROTECTED]> wrote:
>
>
>
> > Wasn't it [EMAIL PROTECTED] who wrote:
>
> > >Thanks for the help Mike (us Lancastrians laugh in the face of
> > >technology).
>
> > Sorry. Ignore me. Esa is right.
>
> > Try to think about the user mouseovering the list after your for loop
> > has finished.
>
> > --http://econym.org.uk/gmap
> > The Blackpool Community Church Javascript Team
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---