for (var i = 0; i < pic.length; i++) {
pic[i].onclick = function () {
var aA = this.getAttribute("href");
return false;
}
}
The for loop has been traversed to bind the click event. When you click on picture 1, you can already get the value of href in the label (note: href is the jump link in the A label, return false is to not jump), now I want to get the href value of the previous label and the next label when the current pattern is clicked, so that the middle picture displays pattern 1, the left pattern displays pattern 4, and the right pattern displays pattern 2. How to do this?
Thank you, your method is very good. You set an index attribute on the element and adjacent elements. I understand.
This is how I write it now, but I still need to figure out how to make the point appear first. The fourth picture
<script>
</script>