Template:TapToLoadMap

Revision as of 09:13, 15 February 2025 by Minionguyjpro (talk | contribs) (Created page with "<div class="tap-container"> <button onclick="loadIFrame(this)" data-url="{{{1}}}">Tap to Load Map</button> <div class="iframeContainer" style="display: none;"></div> </div> <script> function loadIFrame(button) { var container = button.nextElementSibling; // Selects the next div (iframeContainer) var url = button.getAttribute("data-url"); // Gets URL from button attribute // Hide button button.style.display = "none"; // Insert iframe dynamic...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
   <button onclick="loadIFrame(this)" data-url="{{{1}}}">Tap to Load Map</button>

<script> function loadIFrame(button) {

   var container = button.nextElementSibling; // Selects the next div (iframeContainer)
   var url = button.getAttribute("data-url"); // Gets URL from button attribute
   // Hide button
   button.style.display = "none";
   // Insert iframe dynamically
   container.innerHTML = '<iframe src="' + url + '" height="300" width="100%" style="border: none;"></iframe>';
   container.style.display = "block";

} </script>