麻烦无效的参数切换基于jQueryUI的标签时, [英] Trouble with invalid argument when switching jQueryUI based tabs
问题描述
要重现错误,用IE - 单击方向选项卡,然后任何其他人
To reproduce the error, using IE - click the directions tab, then any of the others.
我想要做的是这样的:
在页面加载,这样做真的没什么。然而,当方向加载选项卡 - 设置地图。像这样:
On page load, do nothing really. However, when the directions tab loads - setup the map. Like so:
$('#tabs').bind('tabsshow', function(event, ui) {
if (ui.panel.id == "tabs-5") {
// get map for directions
var dirMap = new GMap2($("div#dirMap").get(0));
dirMap.setCenter(new GLatLng(35.79648921414565,139.40663874149323), 12);
dirMap.enableScrollWheelZoom();
dirMap.addControl(new PanoMapTypeControl());
geocoder = new GClientGeocoder();
$("#dirMap").resizable({
stop: function() { dirMap.checkResize(); }
});
// clear dirText
$("div#dirMapText").html("");
dirMap.clearOverlays();
var polygon = new GPolygon([new GLatLng(35.724496338474104,139.3444061279297),new GLatLng(35.74748750802863,139.3363380432129),new GLatLng(35.75765724051559,139.34303283691406),new GLatLng(35.76545779822543,139.3418312072754),new GLatLng(35.767547103447725,139.3476676940918),new GLatLng(35.75835374997911,139.34955596923828),new GLatLng(35.755149755962755,139.3567657470703),new GLatLng(35.74679090345495,139.35796737670898),new GLatLng(35.74762682821177,139.36294555664062),new GLatLng(35.744422402303826,139.36346054077148),new GLatLng(35.74860206266584,139.36946868896484),new GLatLng(35.735644401200986,139.36843872070312),new GLatLng(35.73843117306677,139.36174392700195),new GLatLng(35.73592308277646,139.3531608581543),new GLatLng(35.72686543236113,139.35298919677734),new GLatLng(35.724496338474104,139.3444061279297)], "#f33f00", 5, 1, "#ff0000", 0.2);dirMap.addOverlay(polygon);
// load directions
directions = new GDirections(dirMap, $("div#dirMapText").get(0));
directions.load("from: Yokota@35.74005964772476,139.37083393335342 to: Ruby International@35.79648921414565,139.40663874149323");
}
});
到底是什么导致了错误? JavaScript调试器宣称错误的IE在于main.js,行139字28(谷歌地图API的文件)。这是这一行:
What the heck is causing the error? The IE javascript debugger claims the error lies in main.js, line 139 character 28. (the google maps api file). Which is this line:
function zf(a,b){a=a.style;a.width=b.getWidthString();a.height=b.getHeightString()}
任何想法?在此先感谢!
Any ideas? Thanks in advance!
推荐答案
这个问题似乎是一个已知的问题与jQuery标签和IE,请参见:<一href=\"http://docs.jquery.com/UI/Tabs#...my_slider.2C_Google_Map.2C_sIFR_etc._not_work_when_placed_in_a_hidden_.28inactive.29_tab.3F\"相对=nofollow>为什么我的滑块,谷歌地图,sIFR的等不得放置在一个隐藏的(未激活)选项卡时工作?
The problem appears to be a known issue with jQuery Tabs and IE, see: Why does my slider, Google Map, sIFR etc. not work when placed in a hidden (inactive) tab?
建议的解决方案是重写使用jQuery标签CSS:
The suggested solution is to override the jQuery Tabs CSS using:
.ui-tabs .ui-tabs-hide {
position: absolute;
left: -10000px;
}
不过,这不会立即解决您的问题,因为如果你搜索CSS,你会看到你的.ui-标签隐藏定义包含:
However, this does not immediately fix your problem because if you search the CSS you will see that your .ui-tabs-hide definition contains:
.ui-tabs .ui-tabs-hide { display: none !important; }
这使得CSS建议的修复效果不佳。因此,要解决这个问题,你需要调整建议的修复,使其读取:
This CSS makes the suggested fix ineffective. So to fix the problem you need to tweak the suggested fix so that it reads:
.ui-tabs .ui-tabs-hide {
display: block !important;
position: absolute;
left: -10000px;
}
这应该摆脱这个问题。 HTH。
This should get rid of the problem. HTH.
这篇关于麻烦无效的参数切换基于jQueryUI的标签时,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!