I have an SVG map, which contains some blips
map
i want when i click to this bilps open modal with some informations
i have js file code ,file.js
.enter()
.append("a")
.attr("href", function (d, i) {
return d.link ? d.link : "#"; // stay on same page if no link was provided
})
// Add a target if (and only if) there is a link and we want new tabs
.attr("target", function (d, i) {
return (d.link && config.links_in_new_tabs) ? "_blank" : null;
})
// blip link
if (d.active && d.hasOwnProperty("link") && d.link) {
blip = blip.append("a")
.attr("xlink:href", d.link);
if (config.links_in_new_tabs) {
blip.attr("target", "_blank");
}
}
and HTML code,index.html
<body>
<svg id="map"></svg>
<script>
//some codes
entries: [
{
"x": 3,
"y": 2,
"z": "AWS",
"active": true,
"link": "www.google.com"
},
</script>
so when click to the bilp it open the link URL ,i want to change it to be a modal window
Any recommendations??
2
Answers
I upload the code in codepen so we can edit on it here we go Visit
[https://codepen.io/mirosoft/pen/BaGXxZR][1]
Create a regular modal popup and update your JavaScript code to open the modal when a blip is clicked.