答案 0 :(得分:0)
This might help: http://forum.highcharts.com/highslide-js-usage/multiple-hs-close-t22148/
But if you're not using a dimming background, clicking outside of an expander won't close it. How could it? You might be clicking on another thumbnail to open it - it can't tell the difference.
答案 1 :(得分:0)
在我的控制台上做了一些研究后,我想出了这个解决方案并且工作得非常好......
$(document).mouseup(function (e)
{
if($(".highslide-wrapper").length==0)
return;
var container = $(".highslide-wrapper");
if (!container.is(e.target)
&& container.has(e.target).length === 0)
{
for (var i = 0; i < hs.expanders.length; i++) {
var exp = hs.expanders[i];
if (exp) exp.close();
}
}
});
您还可以检查点击的元素是否是另一个缩略图..
答案 2 :(得分:0)
hs.Expander.prototype.onInit = function(sender) {
for (var i = 0; i < hs.expanders.length; i++) {
var exp = hs.expanders[i];
if (exp) exp.close();
}
};