我一直在尝试这么多不同的代码,但我似乎无法使用我的iframe。我不能使用jquery所以我正在寻找一个javascript / css答案
我希望用户将map1视为默认值并单击map2,以查看map2并隐藏map1。
<a href="javascript:toggle('map1')" ><b>map1</b></a>
<a href="javascript:toggle('map2')" ><b>map2</b></a>
<div id="map1">
<div class="embed-container">
<iframe class="crime-rate-wards" width="500" height="400" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" title="crime"
src="http://birkbeck.maps.arcgis.com/apps/Embed/index.html?webmap=8a4e79b3c8584a75bda00b262d84263f&
extent=-0.5836,51.3506,0.4252,51.6629&home=true&zoom=true&scale=true&legend=true&disable_scroll=true&theme=light">
</iframe>
</div>
</div>
<div id="map2" style="display:none;">
<div class="embed-container">
<iframe class="crime-rate-borough" width="500" height="400" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" title="crime2"
src="http://birkbeck.maps.arcgis.com/apps/Embed/index.html?webmap=e96ac6e24dc94b919945e7c95be2ee95&
extent=-0.5836,51.3506,0.4252,51.6629&home=true&zoom=true&legend=true&disable_scroll=true&theme=light">
</iframe>
</div>
</div>
这是jfiddle http://jsfiddle.net/Luffydude/PPhqQ/36/