javascript - HTML calling function using id -
the html code below calling plusslides
function activates array example.
<div class="slideshow-container"> <div class="myslides" id=test1> </div> <div class="myslides" id=test2> </div> <div class="myslides" id=test3 > </div> <a class="prev" onclick="plusslides(-1)">❮</a> <a class="next" onclick="plusslides(1)">❯</a> </div>
once plusslides
array calls myslides
class, want leaflet layers added map. done when user clicks on prev
, next
. code below example of javascript test1:
document.getelementbyid("test1").addeventlistener("toggle", watermap); function watermap() { map.addlayer(watermainlayer); }
i trying add toggle event listener test1 once myslides
class has been called, watermap function, adds leaflet layer map, activate. doing wrong not know how go it. may me?
if you, take simple solution: add in function showslides(n)
if(n == 1) //change index wherever wants watermap();
i use reference link of example give us
Comments
Post a Comment