Mo Beigi
Mo Beigi

Reputation: 1765

A HREF Link does not work for constantly changing inner span

Take a look at this JSFiddle: https://jsfiddle.net/8wbxc2a3/1/

Basically I am applying a rainbow effect to some text. I also want to be able to link this text to another webpage. However, clicking on the link does not work. The JSFiddle does an alert to demonstrate my point.

If we increase the animateInterval from 125 to say 500, it will begin working again. What is the issue here exactly and how can we fix it so linking works all the time?

Upvotes: 1

Views: 48

Answers (1)

Asons
Asons

Reputation: 87191

By changing the z-index on the .test element, it will work

a {
  position: relative;
  z-index: 1;            /*  Edge/IE wanted this too for it to work  */
}
.test {
  position: relative;
  z-index: -1;
}

Updated fiddle

Upvotes: 2

Related Questions