Hello guys,
Im quite new on asp.net Core.
On my website i have a banner wich is a single image.
I use a map to set the clicakble areas and the links they must navigate to.
But my banner is a responsive img, so i had to find a way to recalculate the area coords when it is resized.
After some search, i found and i managed to use this fonction that i've put in the environnement section
( I m not really sure this is were i should put it actually )
So, this work perfectly on my visual studio but when i déploy it on Azure it doesnt at all
I have add 2 popup box and i notice the script doesnt run at all.
Can you help me please ?
Thanks in advance
David
<environment names="Development"><script src="~/lib/jquery/dist/jquery.js"></script><script src="~/lib/bootstrap/dist/js/bootstrap.js"></script><script src="~/js/site.js" asp-append-version="true"></script><script>
var ImageMap = function (map, img) {
var n,
areas = map.getElementsByTagName('area'),
len = areas.length,
coords = [],
previousWidth = 128;
window.alert("main")
for (n = 0; n < len; n++) {
coords[n] = areas[n].coords.split(',');
}
this.resize = function () {
window.alert("resize")
var n, m, clen,
x = img.offsetWidth / previousWidth;
for (n = 0; n < len; n++) {
clen = coords[n].length;
for (m = 0; m < clen; m++) {
coords[n][m] *= x;
}
areas[n].coords = coords[n].join(',');
}
previousWidth = img.offsetWidth;
return true;
};
window.onresize = this.resize;
},
imageMap = new ImageMap(document.getElementById('BannerMap'), document.getElementById('BannerImg'));
imageMap.resize();</script></environment>