Skip to content
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

Issue when page is smaller than map (possible Bootstrap conflict?) #72

Closed
philjones88 opened this issue Jul 15, 2012 · 14 comments
Closed
Labels

Comments

@philjones88
Copy link

Hello,

The below fiddle works fine, if your browser window size is > that the image, so e.g. 1280x1024 is fine, it resizes fine.

But. If your browser window size is smaller than the image, e.g. 640x480, the imagemap goes funky and calculates the areas wrong.

http://jsfiddle.net/cC2VG/2/

and make the output window small

or

http://jsfiddle.net/cC2VG/2/embedded/result/

and make your browser window small (e.g. 640x480)

I'm still trying to figure out if it is a conflict with some Bootstrap CSS or layout code.

Any help would be great, been struggling with this for 2 days so far :(

@jamietre
Copy link
Owner

I can see this behavior and I'm pretty sure it's because of CSS that's inherited by body. This looks like a bug in imagemapster, i'm not sure why this hasn't come up in jsfiddle before though, but maybe it has to do with bootstrap. I'll get back to you later today but this should not be too hard to fix.

@philjones88
Copy link
Author

Ah thank you. Was loosing my mind trying to figure out what the cause was!

@jamietre
Copy link
Owner

http://jsfiddle.net/jamietre/mttkn/

This is fixed in the "altimage-enhancements" branch. I had made some significant changes to the image loading code where the source of this problem happened to be, so I decided to address it in this branch rather than going back to the old code.

There are a lot of other changes there. Tests all pass but I haven't run it through different browsers yet. It seems to be fine, but it's new so I will probably kick it around for a couple more days before I update the release code.

@philjones88
Copy link
Author

Hello,

My initial testing (using FF) confirms the size bug is fixed (yay!) but there seems to be something wrong with tooltips now as they don't show and Firebug logs this error:

e.showToolTip is not a function

e.showToolTip();

Line 2581 (in non min version).

I'll try and see if I can fix it myself

@jamietre
Copy link
Owner

I have another branch with a bunch of work on tooltips. I forked this from that one originally but then reverted the tooltip code because it's not at all tested. So it's very likely I screwed something up, let me see what happened.

@jamietre
Copy link
Owner

OK, simple problem, I had renamed that method in the tooltip code but didn't revert the references to it elsewhere. Looks good now. At one time I had tests for the tooltips... apparently they got lost when when I migrated some old tests, argh.

@philjones88
Copy link
Author

Hmm. Did you run your build script? Seems dist folder didn't get updated and I can't get the build working on my machine. It produces a file that doesn't work at all?

@jamietre
Copy link
Owner

Oops - I didn't commit after I ran the build. It's pushed now. Also, you're right, the rake file is out of date, i split mapdata into two files, will update.

@jamietre
Copy link
Owner

Rake file updated, verified it builds correctly with current version of uglifier installed.

@philjones88
Copy link
Author

Thanks. Seems in IE9 that the map is still a little off (its a few pixels wrong height wise), it looks like something is causing this. Not sure if Bootstrap CSS again.

@jamietre
Copy link
Owner

It looks fine to me in IE9, what's wrong from your end? It's definitely jacked in IE7-8 but I think that has to do with the code you're using to detect the size, I didn't look at that too much.

@philjones88
Copy link
Author

Yeh, IE9 issue was due to some margin from the element above "overflowing" into the map div and pushing it down by 2px.... FF/Chrome didn't bother with those 2px.

I haven't done much IE7-8 testing with it yet, I guess resize code is bad then? I see from other examples you have already written some resize JS?

@philjones88
Copy link
Author

Actually works fine in IE8 + IE7. Everything fixed and working, Can close! :)

@jamietre
Copy link
Owner

Sweet. Will make this official as soon as I can get the altimage stuff tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants