Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

244
Visualizações
I am having trouble understanding the Leader-Line js documentation

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(); });
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Here is what you are looking for

line.show('draw', {
  animOptions: {
    duration: 3000,
    timing: [0.5, 0, 1, 0.42]
  }
})

And now you can call this in any function

button.addEventListener('click', function() {
  line.show('draw', {
    animOptions: {
      duration: 3000,
      timing: [0.5, 0, 1, 0.42]
    }
  })
});

about 4 years ago · Juan Pablo Isaza Relatório

0

Your code does not work because you have to put only value like below.

var line = new LeaderLine(startElement, endElement, {hide: true});

startElement.addEventListener("click", function () {
  line.show("draw", {duration: 3000, timing: 'linear'});
});
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda