2013-07-03 38 views

回答

2

我有這個解決方案,請參閱下面的示例。 您的意見是?

<html> 
<body> 
<textarea cols=50 ondblclick="checkDblClick(event)">abc1space abc2space abc3space abc 
</textarea> 
<script> 


function checkDblClickDelayed(target) { 

    while (target.value.substr(target.selectionEnd -1, 1) == " ") { 
     target.selectionEnd = target.selectionEnd - 1; 
    } 
} 

function checkDblClick(e) { 
//we make a delay of 0ms to wait until the selection is in the final position 
    target = e.target; 
    setTimeout(function() 
      { 
     checkDblClickDelayed(target); 
     } 
     , 0); 
} 


</script> 

</body> 
</html> 
+0

很好用!謝謝! – kicaj

+0

在我的情況下(vue.js)whitesace在雙擊後閃爍'<1s',但解決方案正常工作!非常感謝! – user3479125

-1

答案是......你不能。

最接近你可以得到的是雙擊文本,然後Shift +單擊它。

0

在Firefox about:config中查找:

layout.word_select.eat_space_to_next_word

設置爲false。