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

Wrong position in modal window. #67

Open
LamerVK opened this issue Jun 24, 2014 · 2 comments
Open

Wrong position in modal window. #67

LamerVK opened this issue Jun 24, 2014 · 2 comments

Comments

@LamerVK
Copy link

LamerVK commented Jun 24, 2014

I have a problem with position of area in modal window.
When I open modal window, box and outer boxes are positioned at a scrolled distance ( http://c2n.me/inJHEd ).
I fix it like this:
In update function (line 322) i change this:
$box.css({ left: viewX(selection.x1), top: viewY(selection.y1) })
.add($area).width(w = selection.width).height(h = selection.height);
to this:
$box.css({ left: viewX(selection.x1), top: viewY(selection.y1)-$(window).scrollTop() })
.add($area).width(w = selection.width).height(h = selection.height);

and this:
$($outer[0]).css({ left: left, top: top,
width: selection.x1, height: imgHeight });
$($outer[1]).css({ left: left + selection.x1, top: top,
width: w, height: selection.y1 });
$($outer[2]).css({ left: left + selection.x2, top: top,
width: imgWidth - selection.x2, height: imgHeight });
$($outer[3]).css({ left: left + selection.x1, top: top + selection.y2,
width: w, height: imgHeight - selection.y2 });
to this

$($outer[0]).css({ left: left, top: top-$(window).scrollTop(),
width: selection.x1, height: imgHeight });
$($outer[1]).css({ left: left + selection.x1, top: top-$(window).scrollTop(),
width: w, height: selection.y1 });
$($outer[2]).css({ left: left + selection.x2, top: top-$(window).scrollTop(),
width: imgWidth - selection.x2, height: imgHeight });
$($outer[3]).css({ left: left + selection.x1, top: top-$(window).scrollTop() + selection.y2,
width: w, height: imgHeight - selection.y2 });

its help for me: http://c2n.me/inJLgg

@ableade
Copy link

ableade commented Jan 7, 2015

make sure you set parent when calling the plugin if you are using bootstrap

@LamerVK
Copy link
Author

LamerVK commented Jan 10, 2015

No, I dont us bootstrap.

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

2 participants