I have scoured the Internet far and wide and while I found this stackoverflow post insightful Is it possible to change the position of Bootstrap popovers based on screen width?, it still didn't answer my question, likely due to my trouble understanding position/offset.
这就是我想要做的.我希望Twitter Bootstap弹出窗口的位置是正确的,除非热点弹出窗口将位于视口之外,然后我希望它位于左侧.我正在制作一款有热点的iPad web应用,当你按下热点时,信息会出现,但我不想让它在水平滚动被锁定时出现在视口之外.
I'm thinking it'd go something like this:
$('.infopoint').popover({
trigger:'hover',
animation: false,
placement: wheretoplace
});
function wheretoplace(){
var myLeft = $(this).offset.left;
if (myLeft<500) return 'left';
return 'right';
}
Thoughts? Thanks!