How to use google.maps.event.trigger(map, 'resize')

前端 未结 5 1606
無奈伤痛
無奈伤痛 2020-11-28 12:49

I am new to JS, and have found the answer to a previous question, which brought up a new question, which brought me here again.

I have a Reveal Modal that contains a

5条回答
  •  迷失自我
    2020-11-28 13:38

    There were actually a couple of problems with your source code.

    • The initialize() function is created, but never called
    • The $(document).ready should be called after jQuery us loaded
    • The map should be a global variable (like @Cristiano Fontes said) and not a var map
    • (Important) The click event is never called. You're trying to combine the two methods Reveal from Zurb provides to open a dialog (one with JS, one with only HTML). You need to use the only JS method.
    • You're using the wrong ID (#myModal1 is never located in the HTML).

    And now: Download the solution (Please provide us with a download/JSFiddle next time, so we don't need to create this ourselves).

    Hope it helped!

提交回复
热议问题