sachinchoolur / lightgallery.js

Full featured JavaScript image & video gallery. No dependencies
https://sachinchoolur.github.io/lightgallery.js/
Other
5.3k stars 596 forks source link

Create an dynamic Google-Map Iframe-Link #112

Closed adrian-cerdeira closed 4 years ago

adrian-cerdeira commented 6 years ago

Hello Guys

My question / problem is: Is possible to make the iframe link: <a id="idNamel" data-iframe="true" data-src="url" lg-event-uid="&amp;1" lg-uid="lg0">Gampel Bratsch</a>

dynamic in an JavaScript-Function? For the beginning I have this code, but it doesnt work:

function createLinkElement(textTitle, googleMapLink) { var linkElement = document.createElement("a"); linkElement.appendChild(document.createTextNode(textTitle)); linkElement.className = "location-festival"; linkElement.setAttribute("data-iframe", "true"); linkElement.setAttribute("data-src", googleMapLink); linkElement.setAttribute("lg-event-uid", "&1"); linkElement.setAttribute("lg-uid", "lg0"); return linkElement; }

Thanks for an answer.

adrian-cerdeira commented 5 years ago

Well no idea?

adrian-cerdeira commented 4 years ago

Nevermind was a mistake by myself. a-Tag was just false set:

            "location": "<a class='location-festival' data-iframe='true' data-src='" + locationUrl + "'" + ">" + location + "</a>",