Created
September 30, 2013 03:49
-
-
Save syllog1sm/6759165 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var placement = (steps[i].options && steps[i].options.placement) ? steps[i].options.placement : options.placement; | |
var css = {}; | |
if (placement === 'right') { | |
css.top = top + (height / 3) + "px"; | |
css.left = left + element.outerWidth() + margin; | |
} else if (placement === 'left') { | |
css.top = top + (height / 3) + "px"; | |
css.left = (left - element.outerWidth()) - margin; | |
} else if (placement === 'bottom') { | |
css.top = (height + top + margin + 10) + "px"; | |
if ((left + bubble.outerWidth()) > $(document).width()) { | |
$(".guideBubble-arrow", bubble).css({"right": "10px"}); | |
css.left = left + (element.outerWidth() - bubble.outerWidth()) + margin; | |
} else { | |
$(".guideBubble-arrow", bubble).css({"right": "auto"}); | |
css.left = left; | |
} | |
} else if (placement === 'top') { | |
css.top = (((top - bubble.outerHeight()) - margin) - 20) + "px"; | |
if ((left + bubble.outerWidth()) > $(document).width()) { | |
$(".guideBubble-arrow", bubble).css({"right": "10px"}); | |
css.left = left + element.outerWidth() - bubble.outerWidth() + margin; | |
} else { | |
$(".guideBubble-arrow", bubble).css({"right": "auto"}); | |
css.left = left + margin; | |
} | |
} | |
$('.guideBubble-arrow').attr('data-placement', placement); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment