Skip to content

Commit b95d7c4

Browse files
author
Yaron Nachshon
committed
reposition fix
1 parent 1a4bbf3 commit b95d7c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

intro.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
var xPos = position.split(' ')[0];
2121
var yPos = position.split(' ')[1];
2222
var targetBoundingClientRect = $(target).get(0).getBoundingClientRect();
23+
var oldOffset = $(element).get(0).getBoundingClientRect();
2324
var newOffset = {};
2425

2526
xPos = xPos || 'center';
@@ -41,7 +42,7 @@
4142
newOffset.top = targetBoundingClientRect.bottom - element.outerHeight();
4243
}
4344

44-
if(duration === 0){
45+
if(duration === 0 || ((oldOffset.left === newOffset.left) && (oldOffset.top === newOffset.top))){
4546
defer.resolve();
4647
}else{
4748
$(element).one('transitionend', function(){

0 commit comments

Comments
 (0)