Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tkfm-yamaguchi/7518384 to your computer and use it in GitHub Desktop.
Save tkfm-yamaguchi/7518384 to your computer and use it in GitHub Desktop.
Original : rwdImageMaps jQuery plugin v1.5 Chrome/Safari (webkit) で画像のロードに遅延が発生した場合など、画像のオリジナルサイズが正しく取得できないことがあったのを修正
--- pre.rwdImageMaps.js 2013-11-18 05:54:45.588799920 +0900
+++ post.rwdImageMaps.js 2013-11-18 05:53:19.692799931 +0900
@@ -37,6 +37,14 @@
h = temp.height;
}
+ // To get the natural width and height on Webkit, just use this.(width/height)
+ if (!w || !h) {
+ if (!w)
+ w = this.width;
+ if (!h)
+ h = this.height;
+ }
+
var wPercent = $that.width()/100,
hPercent = $that.height()/100,
map = $that.attr('usemap').replace('#', ''),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment