<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>JK:支持民族工业,尽量少买X货</title>
</head><body onmousemove="mouseMoveToSelectFun(this)" >
Ctrl + 鼠标 = 选中<br>
<br>
Would you like bananas ?<br>
Would you like bananas ?<br>
Would you like bananas ?<br></body></html>
<script language=javascript>
function mouseMoveToSelectFun(obj)
{
if(!event.ctrlKey) return false;
var theRange=obj.createTextRange();
theRange.moveToPoint(event.x,event.y);
theRange.moveStart("word",-1);
theRange.moveEnd("word",1);
theRange.select();
}</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>JK:支持民族工业,尽量少买X货</title>
</head><body onmousemove="mouseMoveToSelectFun(this)" >
Ctrl + 鼠标 = 选中<br>
<br>
Would you like bananas ?<br>
Would you like bananas ?<br>
Would you like bananas ?<br></body></html>
<script language=javascript>
function mouseMoveToSelectFun(obj)
{
if(!event.ctrlKey) return false;
var theRange=obj.createTextRange();
theRange.moveToPoint(event.x,event.y);
theRange.moveStart("word",-1);
theRange.moveEnd("word",1);
theRange.select();
}</script>
解决方案 »
- select 设置 multiple IE6下取 object.options.selectedIndex出错
- jquery设置自定义属性为gc=“g”样式为隐藏
- 一个页面中多个javascript
- 就问一点,如何控制背景图片的大小
- javascript 正则表达式
- javascript提示未定义
- 文本框中的value值里有双引号该怎么办啊
- 在input里输入一字符串,然后要让select下拉框里的选项按此排序,请教怎么实现???
- 各位大侠!游侠!如何用javascript实现下拉框<select>与另一个<select>的联动呢???
- 对话框创建成功,但样式没起作用
- 第一次加载iFrame可以自适应高度,但第二次处理时确不行。
- javascript如何读取自身文件内的xml
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>FTS:支持民族工业,尽量少买X货</title>
</head><body onmousemove="mouseMoveToSelectFun(this)" >
Ctrl + 鼠标 = 选中<br>
<br>
Would you like bananas ?<br>
Would you like bananas ?<br>
Would you like bananas ?<br></body></html>
<script language=javascript>
function mouseMoveToSelectFun(obj)
{
var theRange=obj.createTextRange();
theRange.moveToPoint(event.x,event.y);
theRange.expand("word");
theRange.select();
}</script>
<script language="javascript" type="text/javascript">
document.onmousemove = mouseMove;function showIt(obj)
{
var con = ['你好','世界','You','Good'];
var reg = /\d+/;
var id = obj.id.match(reg);
var t = document.getElementById("con");
t.innerText = con[parseInt(id)];
}function hiddenIt()
{
document.getElementById('con').visibility='hidden';
}function mouseMove()
{
var t = document.getElementById("con");
t.style.left = event.x-5;
t.style.top = event.y-8;
}
</script>
</HEAD><BODY>
<div id="pnode" style="position:absolute;z-index:5">
<div id="con" style="border:1px solid #CCFFFF;background:#FFFFCC;color:#55A69A;position:relative;z-index:10;width:60px;height:60px;"></div>
<span id="w0" onmouseover="showIt(this);" onmouseout="hiddenIt();" style="width:50px;">Hello</span>
<span id="w1" onmouseover="showIt(this);" onmouseout="hiddenIt();" style="width:50px;">World</span>
<span id="w2" onmouseover="showIt(this);" onmouseout="hiddenIt();" style="width:50px;">你</span>
<span id="w3" onmouseover="showIt(this);" onmouseout="hiddenIt();" style="width:50px;">好</span>
</div>
</BODY>
</HTML>
1:把它放到复制板当中去clipboardData,
2:再从中去取数据window.clipboardData.getData("Text");
3:进行后续处理;
获取数据可以用xmlhttp的方式从服务器上获取。
不过为了性能,可以预读出来放在javascript数组里。
查都懒得查就问别人,那永远当别人的学生----------------
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>JK:支持民族工业,尽量少买X货</title>
</head><body onmousemove="mouseMoveToSelectFun(this)" >
<input id=aaa >Ctrl + 鼠标 = 选中<br/>
<br/>
Would you like bananas ?<br/>
Would you like bananas ?<br/>
Would you like bananas ?<br/></body></html>
<script language=javascript>
function mouseMoveToSelectFun(obj)
{
try{
if(!event.ctrlKey) return false;
var theRange=obj.createTextRange();
theRange.moveToPoint(event.x,event.y);
theRange.moveStart("word",-1);
theRange.moveEnd("word",1);
theRange.select();
aaa.value=theRange.text;
}
catch(e)
{
}
}</script>