¿Cómo agregar dos disparadores skrollr a un elemento?

<ul id="nav">
<li><a href="#top">Hello</a></li>
<li><a href="#work">Work</a></li>
<li><a href="#process" data-0="color:white;" data-top-top="color:blue;" data-anchor-target="#portfolio">Process</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contactme">Contact</a></li>
</ul>

This code currently changes the text color on my navigation when I reach the div #portfolio. Is there any way I can add another trigger with a different data-anchor-target? To the same button I might add.

preguntado el 12 de febrero de 14 a las 07:02

No, but want is it that you want to achieve? You could for example use the wrapping <li> and add more keyframes to it. -

1 Respuestas

If you are trying to change the value of attribute on basis of some JavaScript functionality, define that function in 'render' in init();

render: function(data){
  var flag = true; // Here goes your logic to choose if you want to change the attribute
  if(flag) document.getElementById('blue').setAttribute('data-anchor-target', '#blue');
}

Respondido 12 Feb 14, 08:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.