-
-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resizing an image that is not at its natural size originally #69
Comments
I had a similar issue with SVG image where image map has been targeted for different-than-natural resolution and the approach above could not work. I went with a custom attribute and a minor modification:
|
where would you stick this code in? thanks! |
For me this won't work in Safari, so this is my solution...
in the end i got a BrowserCache-Issue, which is solved quick and dirty... :P
|
Seems very odd to me that the imagemap resizer doesn't run when the page opens (in Firefox v.88). If I did anything to resize the window however, the map was fixed so I knew it was working. All I did was add this event: |
After a few tweaks, this script works perfectly.
I have made some changes to my copy of the code to allow an image that is not displayed at natural dimensions to have its map resized.
...
var
/*jshint validthis:true */
map = this,
areas = null, cachedAreaCoordsArray = null, image = null, timer = null,
origwindowwidth = window.innerWidth,
origwindowheight = window.innerHeight;
This works for me.
You could probably refine this to work individual images with origimageheight as a variable in the map and use the image.height on startup if you had multiple maps that could be independently resized.
Thought I'd share.
Kevin.
The text was updated successfully, but these errors were encountered: