Svg Graphael pie.js unhover事件丢失
由于某些奇怪的原因,Graphael并没有一个unhover事件。在pie.js中找到创建悬停事件的这段代码:Svg Graphael pie.js unhover事件丢失,svg,raphael,pie-chart,graphael,Svg,Raphael,Pie Chart,Graphael,由于某些奇怪的原因,Graphael并没有一个unhover事件。在pie.js中找到创建悬停事件的这段代码: chart.hover = function (fin, fout) { fout = fout || function () {}; var that = this; for (var i = 0; i < len; i++) { (function (sector, cover, j) { var o = {
chart.hover = function (fin, fout) {
fout = fout || function () {};
var that = this;
for (var i = 0; i < len; i++) {
(function (sector, cover, j) {
var o = {
sector: sector,
cover: cover,
cx: cx,
cy: cy,
mx: sector.middle.x,
my: sector.middle.y,
mangle: sector.mangle,
r: r,
value: values[j],
total: total,
label: that.labels && that.labels[j]
};
cover.mouseover(function () {
fin.call(o);
}).mouseout(function () {
fout.call(o);
});
})(series[i], covers[i], i);
}
return this;
};
悬停事件具有两个函数-f_in和f_out 因此(使用我现在正在研究的示例)
明天当我破译密码的时候,一定要试试这个。我会让你知道事情的进展。
elproto.unhover = function (f_in, f_out) {
return this.unmouseover(f_in).unmouseout(f_out);
};
pie.hover(
// hover function
function () {
this.sector.stop();
this.sector.scale(1.1, 1.1, this.cx, this.cy);
},
// un-hover function
function () {
this.sector.scale(0.9, 0.9, this.cx, this.cy);
}
);