I am trying to hide a div in my Measurement widget but my attempts have resulted in breaking the widget entirely. I have a div distanceMeasure and I want to hide it. How do I do it? Where does the code go in the widget.js file?
Hi @Anonymous User
If you could attach your code, it would be easier for us to assist.
Generically speaking, if you had a div with id "distanceMeasure" declared in your html, you can hide the div like this in JS:
var selectedDiv = dojo.byId(divId); if(selectedDiv) { selectedDiv.style.display = "none"; }
to show the same div, you can then call:
selectedDiv.style.display = "block";
Hope that helps.
Regards,
Derrick
What do you mean it breaks the widget? What code are you using to hide that div?
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.