我无法理解 Leader-Line js 文档
我正在尝试创建使用引线库从 a 点到 b 点绘制一条线的代码。 https://github.com/anseki/leader-line
它看起来像我需要的部分引用位于方法下
self = line.show([showEffectName[, animOptions]])
,其中 showEffectName: 'draw'
和 animOptions: {duration: 500, Timing: [0.58, 0, 0.42, 1]}
这是一个使用按钮显示/隐藏行的示例
var line = new LeaderLine(startElement, endElement, {hide: true});
showButton.addEventListener('click', function() { line.show(); }, false);
hideButton.addEventListener('click', function() { line.hide(); }, false);
如何在按钮中实现 self= 代码?我什至不确定 self= 是什么意思。下面的代码不起作用
var line = new LeaderLine(startElement, endElement, {hide: true});
line.show() = line.show({showEffectName:'draw'}, {animOptions: {duration: 3000, timing: 'linear'}});
startElement.addEventListener('click', function() { line.show(); });
I am trying to create code that will draw a line from point a to point b using the leaderline library. https://github.com/anseki/leader-line
It looks like the section I need to reference is under Methods
self = line.show([showEffectName[, animOptions]])
where showEffectName: 'draw'
and animOptions: {duration: 500, timing: [0.58, 0, 0.42, 1]}
Here is an example shown using a button to show/hide the line
var line = new LeaderLine(startElement, endElement, {hide: true});
showButton.addEventListener('click', function() { line.show(); }, false);
hideButton.addEventListener('click', function() { line.hide(); }, false);
How do I implement the self= code into the button? I'm not even sure what self= is supposed to mean. The below code does not work
var line = new LeaderLine(startElement, endElement, {hide: true});
line.show() = line.show({showEffectName:'draw'}, {animOptions: {duration: 3000, timing: 'linear'}});
startElement.addEventListener('click', function() { line.show(); });
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这就是您正在寻找的东西
现在你可以在任何函数中调用它
Here is what you are looking for
And now you can call this in any function
您的代码不起作用,因为您必须只输入如下所示的值。
Your code does not work because you have to put only value like below.