当你在 nytimes.com 上的一篇文章中选择文本这么少?在您的选择结束时弹出:
alt text http://img193.imageshack.us/img193/1316/827200941520pm.png
在我的网站上实现类似功能的最佳方式是什么?是否有用于执行此操作的预滚动库?
最佳答案
我想你必须做这样的事情。
$('div.selectableText').mouseUp(function(e){
if (window.getSelection()){
var xCoord = e.pageX;
var yCoord = e.pageY;
//Use the coordinates (or maybe offset)
to position your little modal popup
}
)};
关于javascript - 当用户做出选择时,纽约时报风格的弹出窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1343545/