当前位置:K88软件开发文章中心编程语言JavaScriptJS01 → 文章内容

用的javascript效果(三)

减小字体 增大字体 作者:佚名     来源:asp编程网  发布时间:2018-12-30 8:56:44

-- 
 
作者:木雨心
-- 
 
发布时间:2005-7-12 
11:13:00

-- 
 

21.页面进入和退出的特效
进入页面<
meta 
http-equiv="
Page-Enter"
 
content="
revealTrans(duration=x, 
transition=y)"
>

推出页面<
meta 
http-equiv="
Page-Exit"
 
content="
revealTrans(duration=x, 
transition=y)"
>
 
 

这个是页面被载入和调出时的一些特效。duration表示特效的持续时间,以秒为单位。transition表示使用哪种特效,取值为1-23:
  0 
矩形缩小 

  1 
矩形扩大 

  2 
圆形缩小
  3 
圆形扩大 

  4 
下到上刷新 

  5 
上到下刷新
  6 
左到右刷新 

  7 
右到左刷新 

  8 
竖百叶窗
  9 
横百叶窗 

  10 
错位横百叶窗 

  11 
错位竖百叶窗
  12 
点扩散 

  13 
左右到中间刷新 

  14 
中间到左右刷新
  15 
中间到上下
  16 
上下到中间 

  17 
右下到左上
  18 
右上到左下 

  19 
左上到右下 

  20 
左下到右上
  21 
横条 

  22 
竖条 

  23 
以上22种随机选择一种
22.在规定时间内跳转
<
META 
http-equiv=V="
REFRESH"
 
content="
5
URL=http://www.51js.com"
>
 

23.网页是否被检索
<
meta 
name="
ROBOTS"
 
content="
属性值"
>

  其中属性值有以下一些:
  属性值为"
all"

文件将被检索,且页上链接可被查询;
  属性值为"
none"

文件不被检索,而且不查询页上的链接;
  属性值为"
index"

文件将被检索;
  属性值为"
follow"

查询页上的链接;
  属性值为"
noindex"

文件不检索,但可被查询链接;
  属性值为"
nofollow"

文件不被检索,但可查询页上的链接。
24、email地址的分割
把如下代码加入<
body>
区域中
<

href="
webmaster@sina.commailtwebmaster@sina.com"
>
webmaster@sina.com<
/a>

25、流动边框效果的表格
把如下代码加入<
body>
区域中
<
SCRIPT>

l=Array(6,7,8,9,\&
#39
a\&
#39
,\&
#39
b\&
#39
,\&
#39
b\&
#39
,\&
#39
c\&
#39
,\&
#39
d\&
#39
,\&
#39
e\&
#39
,\&
#39
f\&
#39
)
Nx=5
Ny=35
t="
<
table 
border=0 
cellspacing=0 
cellpadding=0 
height="
+((Nx+2)*16)+"
>
<
tr>
"

for(x=Nx
x<
Nx+Ny
x++)
t+="
<
td 
width=16 
id=a_mo"
+x+"
>
 <
/td>
"

t+="
<
/tr>
<
tr>
<
td 
width=10 
id=a_mo"
+(Nx-1)+"
>
 <
/td>
<
td 
colspan="
+(Ny-2)+"
 
rowspan="
+(Nx)+"
>
 <
/td>
<
td 
width=16 
id=a_mo"
+(Nx+Ny)+"
>
<
/td>
<
/tr>
"

for(x=2
x<
=Nx
x++)
t+="
<
tr>
<
td 
width=16 
id=a_mo"
+(Nx-x)+"
>
 <
/td>
<
td 
width=16 
id=a_mo"
+(Ny+Nx+x-1)+"
>
 <
/td>
<
/tr>
"

t+="
<
tr>
"

for(x=Ny
x>
0
x--)
t+="
<
td 
width=16 
id=a_mo"
+(x+Nx*2+Ny-1)+"
>
 <
/td>
"

document.write(t+"
<
/tr>
<
/table>
"
)
var 
N=Nx*2+Ny*2
function 
f1(y)
{
for(i=0
i<
N
i++)
{
c=(i+y)%20
if(c>
10)c=20-c
document.all["
a_mo"
+(i)].bgColor="
\&
#39

#0000"
+l[c]+l[c]+"
\&
#39
"
}
y++
setTimeout(\&
#39
f1(\&
#39
+y+\&
#39
)\&
#39
,\&
#39
1\&
#39
)}
f1(1)
<
/SCRIPT>

26、JavaScript主页弹出窗口技巧
窗口中间弹出
<
script>

window.open("
http://www.cctv.com"
,"
"
,"
width=400,height=240,top="
+(screen.availHeight-240)/2+"
,left="
+(screen.availWidth-400)/2)

<
/script>

============
<
html>

<
head>

<
script 
language="
LiveScript"
>

function 
WinOpen() 

{
 
 
 
msg=open("
"
,"
DisplayWindow"
,"
toolbar=no,directories=no,menubar=no"
)

 
 
 
msg.document.write("
<
HEAD>
<
TITLE>
哈 
罗!<
/TITLE>
<
/HEAD>
"
)

 
 
 
msg.document.write("
<
CENTER>
<
H1>
酷 
毙 
了!<
/H1>
<
h2>
这 
是<
B>
JavaScript<
/B>
所 
开 
的 
视 
窗!<
/h2>
<
/CENTER>
"
)

}
<
/script>

<
/head>

<
body>

<
form>

<
input 
type="
button"
 
name="
Button1"
 
value="
Push 
me"
 
onclick="
WinOpen()"
>

<
/form>

<
/body>

<
/html>

==============
一、在下面的代码中,你只要单击打开一个窗口,即可链接到赛迪网。而当你想关闭时,只要单击一下即可关闭刚才打开的窗口。
  代码如下: 

  <
SCRIPT 
language="
JavaScript"
>
 

  <
!-- 

  function 
openclk() 



  another=open(\&
#39
http://www.xawebs.com\&
#39
,\&
#39
NewWindow\&
#39
)
 

  } 

  function 
closeclk() 



  another.close()
 

  } 

  //-->
 

  <
/SCRIPT>
 

  <
FORM>
 

  <
INPUT 
TYPE="
BUTTON"
 
NAME="
open"
 
value="
打开一个窗口"
 
onClick="
openclk()"
>
 

  <
BR>
 

  <
INPUT 
TYPE="
BUTTON"
 
NAME="
close"
 
value="
关闭这个窗口"
 
onClick="
closeclk()"
>
 

  <
/FORM>
 

  二、上面的代码也太静了,为何不来点动感呢?如果能给页面来个降落效果那该多好啊! 

  代码如下: 

  <
script>
 

  function 
drop(n) 



  if(self.moveBy)


  self.moveBy 
(0,-900)
 

  for(i 

n
 

>
 
0
 
i--)


  self.moveBy(0,3)
 

  } 

  for(j 
=&

[1] [2] [3] [4]  下一页


用的javascript效果(三)