【发布时间】:2019-05-12 14:35:05
【问题描述】:
我正在尝试使用 wheelnav.js 库创建圆形菜单。
尽管它似乎有效,但我在 chrome 控制台中遇到了数千个错误。
错误:属性 d:预期数字,“M,0,0”。
错误:属性 dy:预期长度,“NaN”。
在我自己的调试过程中,我设法找到了人们在这些线程中列出的相同原因:
https://github.com/DmitryBaranovskiy/raphael/issues/593
https://github.com/DmitryBaranovskiy/raphael/issues/620
https://github.com/fperucic/treant-js/issues/73
尽管这些线程已经很老了,但它们仍然是打开的,我找不到解决我的问题的方法。我什至找不到一个优雅的方法来覆盖 raphaels 的函数。
var icons = {
'section_sign': '\u00A7\n',
'key': '\uf084\n',
'cogs': '\uf085\n',
};
var items = [ {title: icons.key + 'Security&\nPasswords'},
{title: icons.cogs + 'Settings&\nDevice'},
{title: icons.section_sign + 'Rules&\nLaw'} ];
var piemenu = new wheelnav('main_menu');
piemenu.initWheel(items.map(function(item){
return item.title;
}));
piemenu.createWheel();
有什么想法吗?
感谢您的帮助:)
【问题讨论】:
标签: javascript google-chrome svg raphael wheelnav.js