我知道这是堆栈溢出问题太多的一个问题,我在搜索过程中找到了它们,但是我想这有点不同。

我在wordpress上使用了一个插件,该插件使我可以在页面上使用标签更改内容。
在页面中,我有一个双选项卡,其中一个显示了不同的Google Map嵌入代码。
您可能已经发现了我的问题,当我更改选项卡时,地图的中心出现在左上角。

我找到了javascript和jquery解决方案,但这是一个wordpress页面,我不能在那使用它,所以,如何在我的wordpress网站上解决这个问题?

谢谢!

编辑:

    [tab name="X"]

 

<iframe width="100%" height="auto" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.pt/maps?f=q&amp;source=s_q&amp;hl=pt-BR&amp;geocode=&amp;q=40.654471,-7.914153&amp;aq=&amp;sll=41.236676,-8.332331&amp;sspn=0.593802,1.234589&amp;ie=UTF8&amp;ll=40.654471,-7.914153&amp;spn=0.018721,0.038581&amp;t=m&amp;z=14&amp;output=embed"></iframe><br /><small><a href="http://maps.google.pt/maps?f=q&amp;source=embed&amp;hl=pt-BR&amp;geocode=&amp;q=40.654471,-7.914153&amp;aq=&amp;sll=41.236676,-8.332331&amp;sspn=0.593802,1.234589&amp;ie=UTF8&amp;ll=40.654471,-7.914153&amp;spn=0.018721,0.038581&amp;t=m&amp;z=14" target="_blank" style="color:#0000FF;text-align:left">Exibir mapa ampliado</a></small>

[/tab]
[tab name="Y"]

&nbsp;

<iframe width="100%" height="auto" src="http://maps.google.pt/maps?f=q&amp;source=s_q&amp;hl=pt-BR&amp;geocode=&amp;q=40.741339,-7.730044&amp;aq=&amp;sll=40.654483,-7.914145&amp;sspn=0.00936,0.01929&amp;g=40.654483,-7.914145&amp;ie=UTF8&amp;ll=40.741339,-7.730044&amp;spn=0.018696,0.038581&amp;t=m&amp;z=14&amp;output=embed" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<small><a style="color: #0000ff; text-align: left;" href="http://maps.google.pt/maps?f=q&amp;source=embed&amp;hl=pt-BR&amp;geocode=&amp;q=40.741339,-7.730044&amp;aq=&amp;sll=40.654483,-7.914145&amp;sspn=0.00936,0.01929&amp;g=40.654483,-7.914145&amp;ie=UTF8&amp;ll=40.741339,-7.730044&amp;spn=0.018696,0.038581&amp;t=m&amp;z=14" target="_blank">Exibir mapa ampliado</a></small>

[/tab]
[end_tabset]

最佳答案

我找到了javascript和jquery解决方案,但这是一个wordpress页面,我不能在那使用它


我个人使用了名为“内联Javascript插件”的插件,该插件可让您直接在Wordpress页面/帖子中键入JavaScript代码

09-25 18:49
查看更多