<!DOCTYPE html PUBLIC
//W
C//DTD XHTML
Transitional//EN
>
<html xmlns=
>
<head>
<meta http
equiv=
Content
Type
content=
text/html; charset=gb
/>
<title></title>
</head>
<STYLE>
BODY {
SCROLLBAR
FACE
COLOR: #E
F
FE;
SCROLLBAR
HIGHLIGHT
COLOR: #AAC
E
;
SCROLLBAR
SHADOW
COLOR: #fcfcfc;
SCROLLBAR
DLIGHT
COLOR: #fcfcfc;
SCROLLBAR
ARROW
COLOR: #
;
SCROLLBAR
TRACK
COLOR: #fcfcfc;
SCROLLBAR
DARKSHADOW
COLOR: #AAC
E
;
SCROLLBAR
BASE
COLOR: #fcfcfc
}
</STYLE>
<script>
function click(e) {
if (document
all) {
if (event
button==
||event
button==
||event
button==
) {
oncontextmenu=
return false
;
}
}
if (document
layers) {
if (e
which ==
) {
oncontextmenu=
return false
;
}
}
}
if (document
layers) {
document
captureEvents(Event
MOUSEDOWN);
}
document
onmousedown=click;
document
oncontextmenu = new Function(
return false;
)
var travel=true
var hotkey=
/* hotkey即為熱鍵的鍵值
是ASII碼
這裡
代表c鍵 */
if (document
layers)
document
captureEvents(Event
KEYDOWN)
function gogo(e)
{ if (document
layers) {
if (e
which==hotkey&&travel){
//alert(
操作錯誤
或許是您按錯了按鍵!
);
} }
else if (document
all){
if (event
keyCode==hotkey&&travel){
//alert(
操作錯誤
或許是您按錯了按鍵!
);
}}
}
document
onkeydown=gogo
</script>
<link id=
css
type=
text/css
rel=
stylesheet
>
<script src=
common
js
language=
javascript
type=
text/javascript
></script>
<div style=
margin
left:
px;
>歡迎光臨網頁腳本特效中心
點擊運行按鈕演示特效
<br/>
<br /><TEXTAREA id=
temp
class=
htmlarea
><html>
<title>網頁特效代碼|JsCode
CN|
全選並復制表單中內容</title>
<head>
<style>
highlighttext{
background
color:yellow;
font
weight:bold;
}
</style>
</head>
<form name=test>
<input type=
button
value=
全選並復制
onclick=
javascript:HighlightAll(
test
select
)
>
<textarea name=
select
rows=
cols=
>你好
歡迎光臨網頁特效觀止;
textarea>
</form>
<script language=
Javascript
>
<!
var copytoclip=
function HighlightAll(theField) {
var tempval=eval(
document
+theField)
tempval
focus()
tempval
select()
if (document
all && copytoclip==
){
therange=tempval
createTextRange()
therange
execCommand(
Copy
)
window
status=
Contents highlighted and copied to clipboard!
setTimeout(
window
status=
)
}
}
//
>
</script>
</head>
</html>
<a >歡迎訪問網頁特效集</a></TEXTAREA><br/><INPUT onclick=
runEx(
temp
)
type=
button
value=
運 行
class=
submit
/> <INPUT onclick=
doCopy(temp
)
type=
button
value=
復 制
class=
submit
/> <INPUT onclick=
doSave(temp
)
type=
button
value=
保 存
class=
submit
/> <input type=button onclick=
parent
window
neatDialog
close()
class=submit
value=
關閉
/> <span class=
fontgray
> [提示
Ctrl+A 全部選擇
可先修改部分代碼後運行]</span></div>
<body>
</body>
</html>
打包文件下載
From:http://tw.wingwit.com/Article/program/Java/Javascript/201404/30474.html