英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论