是否有可能抛出一个div元素内的文本的jquery-select()事件? 这是我的例子,但它不工作。获取突出显示的文本 - 并导航到URL
<div id='id1'>Hello text</div>
$("#id1").select(function() {
alert("something was selected");
});
我的目标是在文本中选择一个词,并把这个选择的单词在URL,并与这个网址打开一个新窗口。 例如我标记或者更确切地说,我选择的话打招呼,单词Hello应该在这个网址
window.open('http://dict.leo.org/ende?lp=ende&lang=de&searchLoc=0&cmpType=relaxed§Hdr=on&spellToler=&search=Hello');
我不知道apear如果选择事件才是正道。 请帮忙。 抱歉我的英文不好!
检查此问题:http://stackoverflow.com/questions/985272/jquery-selecting-text-in-an-element-akin-to-highlighting-with-your-mouse – Gabe 2012-01-12 22:02:51