Why do my markers end up at the top left corner if I navigate back via ajax?

北城余情 提交于 2019-12-12 00:36:30

问题


When using a Google Map on a page in http://jquerymobile.com; if one navigates away and then back to the map page all the markers end up at the top left corner.

Example:

The start of my jQuery JavaScript snippet:

$('.page-map').live('pageinit', function() {
...do stuff.
}

回答1:


Change 'pageinit' to 'pageshow':

$('.page-map').live('pageshow', function() {
...do stuff.
}


来源:https://stackoverflow.com/questions/9713930/why-do-my-markers-end-up-at-the-top-left-corner-if-i-navigate-back-via-ajax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!