jvectormaps in dropdown menu, NS_ERROR_FAILURE:

守給你的承諾、 提交于 2019-12-04 02:31:01

问题


my jvector maps are in a dropdown menu, it works well in safari, opera and chrome but breaks (no map and error message NS_ERROR_FAILURE:
(line 700 in 2.0.2.min.js "return this.node.getBBox();" in firefox, I've tried lots of different things but no luck.

these are in the head.

<script type="text/javascript" src="jVectormap/jquery-jvectormap-2.0.2.min.js"></script>
<script type="text/javascript" src="../maCountries/be_coord.js"></script>
<script type="text/javascript" src="../maCountries/be_map.js"></script>

this is the html in the dropdown menu

<div id="mapJV">
</div> <!--mapjv container-->

This is the code in be_map.js which breaks in firefox.

$(function() {
var map,
map = new jvm.Map({
container: $('#mapJV'),
map: 'be_mill_en',
backgroundColor:  '#F6F3EF',
regionStyle: {
  initial: {
   fill: '#ABBDC4'
  },
},


});

});
$( "<style>.jvectormap-container {width : 400px; height: 400px;}</style>" ).appendTo( "head" );

the code in be_coord.js is just the normal coordinates.


回答1:


Firefox usually has trouble with rendering SVG inside of the hidden elements. So solution here could be creating and rendering map after its container getting visible.



来源:https://stackoverflow.com/questions/31833621/jvectormaps-in-dropdown-menu-ns-error-failure

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