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

tooltip能否设置出现的位置? #292

Closed
leerom opened this issue Apr 20, 2014 · 4 comments
Closed

tooltip能否设置出现的位置? #292

leerom opened this issue Apr 20, 2014 · 4 comments

Comments

@leerom
Copy link

leerom commented Apr 20, 2014

tooltip弹出的位置是在鼠标的右下方,在移动设备上使用的时候总是被手挡住。试过修改源码让tooltip出现在鼠标上方,但每次升级时都要重新再修改代码,建议提供开放一个option选项可以设置tooltip位置。

@kener
Copy link
Contributor

kener commented Apr 21, 2014

accepted!谢谢反馈,下个版本增加这个回调配置。大概这样设计,你觉得怎么样?
tooltip:{
position: {array | function} // 接受数组和方法
}

array:[x, y], 固定位置[x, y]
function : function([x, y]) {return [newX,newY]},默认显示坐标为输入参数,用户指定的新坐标为输出返回。

@leerom
Copy link
Author

leerom commented Apr 21, 2014

谢谢
建议array:[x,y]中的x,y最好使用偏移量,比如以当前的触摸点为中心,向左上方偏移用负值,向右下方偏移用正值

@kener
Copy link
Contributor

kener commented Apr 21, 2014

恩,我也想过偏移或者delta,但没想好怎么表示固定位置,这可能也需要

kener added a commit that referenced this issue Jun 3, 2014
@kener
Copy link
Contributor

kener commented Jul 23, 2014

2.0

@kener kener closed this as completed Jul 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants