有没有办法将jvector地图与搜索结果链接?

huangapple go评论74阅读模式
英文:

Is there anyway to link a jvector map to a search result?

问题

My requirement is that when a user clicks on a specific country on a continent map (http://jvectormap.com/maps/world/south-america/), it needs to redirect to a search result page with the items in the related country. Can anyone help me write the JS code? (Note: I'm writing this custom JS for a Shopify web)

英文:

So my requirement is that when user click on a specific country on a continent map(http://jvectormap.com/maps/world/south-america/), it needs to be redirect to a search result page with the items in related country. Can anyone help me to write the JS code?(Note: Im writting this custom JS for a shopify web)

答案1

得分: 0

你需要使用事件监听器 onRegionClick

onRegionClick: function (event, code) {
    window.location.href = "替换为用于根据地区代码搜索结果的页面?regionCode=" + code
}

将其替换为你用于按地区代码搜索结果的页面。

英文:

You have to use the event listener onRegionClick

onRegionClick: function (event, code) {
    window.location.href = "yourpage?regionCode=" + code
}

Replace with the page you use to search results by region code.

huangapple
  • 本文由 发表于 2020年1月3日 22:05:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/59579940.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定