js技巧收集(200多个)
document.bgColor = newColor;
selObj.selectedIndex = -1;
}
//-->
</SCRIPT>
<BODY STYLE="font-family:Arial">
<B>Changing Background Colors</B>
<BR>
<FORM>
<SELECT SIZE="8" onChange="bgChange(this);">
<OPTION>Red
<OPTION>Orange
<OPTION>Yellow
<OPTION>Green
<OPTION>Blue
<OPTION>Indigo
<OPTION>Violet
<OPTION>White
<OPTION>pink
</SELECT>
</FORM>
</BODY>
</HTML> copyright dedecms
17.将按钮的特征改变
<style type="text/CSS">
<!--
.style1 { font-size: 12px; background: #CCCCFF; border-width: thin thin thin thin; border-color: #CCCCFF
#CCCCCC #CCCCCC #CCCCFF}
.style2 { font-size: 12px; font-weight: bold; background: #CCFFCC; border-width: thin medium medium thin; dedecms.com
border-color: #CCFF99 #999999 #999999 #CCFF99}
-->
</style>
本例按钮的代码如下:
<input type="submit" name="Submit" value="提 交" onmouseover="this.className='style2'"
本文来自织梦
onmouseout="this.className='style1'" class="style1"> 本文来自织梦
18.改变按钮的图片.
<style type="text/css">
<!--
.style3 { font-size: 12px; background: url(image/buttonbg1.gif); border: 0px; width: 60px; height: 22px}
.style4 { font-size: 12px; font-weight: bold; background: url(image/buttonbg2.gif); border: 0px 0; width: 内容来自dedecms
60px; height: 22px}
-->
</style>
本例的按钮代码如下:
<input type="submit" name="Submit2" value="提 交" onmouseover="this.className='style4'"
本文来自织梦
onmouseout="this.className='style3'" class="style3"> dedecms.com
19.打印页面
<div align="center"><a class=content href="javascript:doPrint();">打印本稿</a></div> dedecms.com
20.可以直接写html语言
document.write(""); 织梦好,好织梦
21.改变下拉框的颜色
<select name="classid"
copyright dedecms
onChange="changelocation(document.myform.classid.options[document.myform.classid.selectedIndex].value)"
size="1" style="color:#008080;font-size: 9pt">
22.转至目标URL
window.location="http://guoguo" 本文来自织梦
23.传递该object的form
UpdateSN('guoqiang99267',this.form)
function UpdateSN(strValue,strForm)
{
strForm.SignInName.value = strValue;
return false;
}
内容来自dedecms
24.文字标签
<label for="AltName4"><input name="AltName" type="RADIO" tabindex="931" id="AltName4" 内容来自dedecms
>guoqiang99859</label> 织梦好,好织梦
25.layer2为组件的ID,可以控制组件是否可见
document.all.item('Layer2').style.display = "block";
document.all.item('Layer2').style.display = "none";//
copyright dedecms
26.将页面加入favorite中
<script language=javascript>
<!--
function Addme(){
url = "http://your.site.address"; //你自己的主页地址
title = "Your Site Name"; //你自己的主页名称
window.external.AddFavorite(url,title);
-->
</script>// dedecms.com
27.过10秒自动关闭页面
文章评论
共有位Admini5网友发表了评论 查看完整内容