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)">&#10094;</a>     <a class="next" onclick="plusslides(1)">&#10095;</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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -