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

The variable pos has an undefined width in Internet Explorer because offsetWidth is not cross-browser. #188

Open
meatballcoder opened this issue Oct 2, 2015 · 0 comments

Comments

@meatballcoder
Copy link

Hi, Not sure how to support or suggest a change to an Open Source project, but I was trying to use tipsy in IE 11 (and below, and Edge emulation as well), and the tooltip appeared all the way on the left of the screen. This worked correctly in Chrome, the tooltip over the element. The problem is that left is always "NaN" because "offsetWidth" is not a valid property for Internet Explorer.

If it matters, I am using this in conjunction with D3 with SVG graphs to add a tooltip to tree element.

I found this,

          var pos = $.extend({}, this.$element.offset(), {
                width: this.$element[0].offsetWidth,
                height: this.$element[0].offsetHeight
            });

And changed it to this,

         var pos = $.extend({}, this.$element.offset(), {
              width: this.$element.outerWidth(),
              height: this.$element.outerHeight()
         });

, and it started working in IE and continued to work in Chrome (and Firefox as well).

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

No branches or pull requests

1 participant