diff options
| author | fat <[email protected]> | 2013-12-24 13:07:42 -0800 |
|---|---|---|
| committer | fat <[email protected]> | 2013-12-24 13:07:42 -0800 |
| commit | a93a753c7d50aadbdb9a0243a9aa04f366855e46 (patch) | |
| tree | 4a1d16a66f30b39995a20865e08e68057b7690a7 /js | |
| parent | fe7fffe034f8a97aae004351ee46fe9a704a971e (diff) | |
| download | bootstrap-a93a753c7d50aadbdb9a0243a9aa04f366855e46.tar.xz bootstrap-a93a753c7d50aadbdb9a0243a9aa04f366855e46.zip | |
fixes #10134 – dont use jquery offset directly because it uses sub pixel rendering
Diffstat (limited to 'js')
| -rw-r--r-- | js/tooltip.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/js/tooltip.js b/js/tooltip.js index f24876139..842a0ebba 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -199,9 +199,18 @@ offset.top = offset.top + marginTop offset.left = offset.left + marginLeft - $tip - .offset(offset) - .addClass('in') + // $.fn.offset doesn't round pixel values + // so we use setOffset directly with our own function B-0 + jQuery.offset.setOffset($tip[0], $.extend({ + using: function (props) { + $tip.css({ + top: Math.round(props.top), + left: Math.round(props.left) + }) + } + }, offset), 0) + + $tip.addClass('in') // check to see if placing tip in new offset caused the tip to resize itself var actualWidth = $tip[0].offsetWidth |
