Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Commit

Permalink
SVG scroll fix. Thanks urkle
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Jan 27, 2011
1 parent 81635a8 commit 1c9bf29
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 71 deletions.
2 changes: 1 addition & 1 deletion dist/jquery.qtip.css
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Mon Jan 24 19:29:04 2011 +0000
* Date: Tue Jan 25 21:09:57 2011 +0000
*/

/* Fluid class for determining actual width in IE */
Expand Down
9 changes: 7 additions & 2 deletions dist/jquery.qtip.js
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Mon Jan 24 19:29:04 2011 +0000
* Date: Tue Jan 25 21:09:57 2011 +0000
*/

"use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
Expand Down Expand Up @@ -2426,7 +2426,8 @@ $.extend(TRUE, $.fn.qtip.defaults, {

$.fn.qtip.plugins.svg = function(svg, corner)
{
var elem = svg[0],
var doc = $(document),
elem = svg[0],
result = {
width: 0, height: 0,
offset: { top: 1e10, left: 1e10 }
Expand Down Expand Up @@ -2457,6 +2458,10 @@ $.fn.qtip.plugins.svg = function(svg, corner)
tPoint = point.matrixTransform(mtx);
result.width = tPoint.x - result.offset.left;
result.height = tPoint.y - result.offset.top;

// Adjust by scroll offset
result.offset.left += doc.scrollLeft();
result.offset.top += doc.scrollTop();
}

return result;
Expand Down

0 comments on commit 1c9bf29

Please sign in to comment.