Open brunodegoyrans opened 6 years ago
w = $that.attr(attrW),h = $that.attr(attrH); ↓ w = $that[0].naturalWidth,h = $that[0].naturalHeight; I made this correction.
I needed to change: $(value).css({display: ''}); ↓ $(value).css({display: 'none'});
...but I found this useful. Thanks!
Symptom: If the img/map is inside a hidden parent, for example in a bootstrap tab, then the map is not working when the parent becomes visible.
Cause: Plugin uses functions width() and height() that are known to mis-work if the parent is hidden. So the wPercent and hPercent have wrong value that might resize the map very small. Then the map seems inoperant.
Solution: Make parents visible just before calling width() then restore invisibility.
Modified code: