Monday, May 26, 2008
Javascript
<script language="javascript">
function testParameters()
{
var params = "";
for(var i=0;i<arguments.length;i++)
{params += " " + arguments[i]; }
alert(params);
}
testParameters("abc",123);
testParameters(123,456,"abc");
</script>
Function:
这两种Function是一样的功能.
var square = new Function("x","y","var sum;sum=x*x + y*y;return sum;");
function square(x,y){
var sum;
sum = x*x + y*y;
return sum;
}
alert(square(2,3);
System function:
encodeURI();
decodeURI();
parseInt(numString,[radix(0x十六进制 0八进制)]);
parseFloat();
isNaN();
escape();
unescape();
eval();链接数据库时可用eval(): such as
eval("alert(persion1."+ x + ");"); x是变量
with语句:
var abc= new a();
with(abc)
{var kk = getMonth();}
in here don't need use var kk=abc.getMonth();
for...in语句:
Sunday, May 25, 2008
CSS的优先级
内联样式表>嵌入样式表>链接样式表
下划线:text-decoration:...
小写字母变大写:text-variant: small-caps
大小写转换:text-transform: uppercase or lowercase
首字母大写转换:text-transform: capitalize
背景颜色为透明:background-color: transparent
背景图像固定or滚动:background-attachment: fixed or scroll
vertical-align: sub(下标),super(上标),top(与顶端对齐),middle(居中),bottom(与底端对齐)
text-align:left,right,center,justify
text-indent:文本首行缩进值
white-space: normal,pre,nowrap(文本在遇到br时才换行)
visibility:inherit(继承外部的属性),visible,hidden
display: block,inline,list-item,none(block类似于div,inline类似于span)
clip:定义绝对定位的显示区域:clip:rect(top,right,bottom,left)
list-style-type: disc, circle, square,decimal,lower-roman,upper-roman,lower-alpha,upper-alpha,none
list-style-image:
list-style-position:inside,outside
cursor:(光标形状) hand,crosshair,text,wait,default,help,e-resize,ne-resize,n-resize,nw-resize,w-resize,sw-resize(西南箭头),s-resize,se-resize,auto
Saturday, May 24, 2008
Meta用法
<label for="usr" accesskey="b">user name(<u>b</u>): </lable>
<input type=text name=user id=usr><br />
</form>
Content-Type:
<meta http-equiv="Content-Type' ctent="text/tl; charset=gb2312">
Refresh头
<mta http-equiv="Refresh" content="1;url=(注意这里没有双引号)http://www..."> 一秒钟之后跳转到新页面
Expires头
<meta http-equiv="Expires" content="Mon, 12 May 2001 00:20:00 GMT">, 将content设置为0,可以禁止浏览器使用缓存页面
Windows-Target
要防止自己的网页被别人当作一个frame页面调用,可以使用<meta http-equiv="Windows-Target" content="_top">
Pragma头
禁止在本地计算机缓存页面
<meta http-equiv=Pragma" content=”no-cache">
更好的方法<meta http-equiv="Cache-Contral" content="no-cache">
Page-Enter和Page-Exit
当进入和退出页面的特殊效果
<meta http-equiv="Page-Enter" content="revealTrans(Transition=23(数字是不同的显示效果), Duration=1.000)">
设置form表中的快捷键
<label for="usr" accesskey="b">user name(<u>b</u>): </lable>
<input type=text name=user id=usr><br />
</form>
Thursday, May 22, 2008
定位标记:
用的是name,such as:<a name="mark">blabla</a>
在同一网页中:<a href="#mark">定位到blabla</a>
在不同网页中:<a href="a.html#mark target=“_blank">准确定位</a>
<a href="#"> 和 <a href="“”">的区别:
<a href="#">使显示网页本身
<a href="">是显示网页文件所在目录
在新网页打开链接:<a href="a.html"> target="_blank">新窗口</a>
-----------------------------------------------------------------------
图像: <img src="a.png" />
可加的属性:alt, align, border, width, height
-------------------------------------------------------------------
图像地图:
<map name="mapname"></map> name是为该地图热点映射指定了一个名称
图像中热点映射中的各个区域用<area>标签说明,其格式为:<area shape="形状" coords="坐标" href="url">, (shap可以有:rect矩形,poly多边形,circle圆形。coords="0,0,50,50( 0,0是左上角 50,50是右下角)多边形用各个顶点坐标,圆形是圆心横纵坐标+第三个参数半径)href 部分亦可以用nohref替换,表示在该区域单击鼠标无效。 <area>标签还可以有一个target属性,用来指明浏览器在哪个窗口或帧中显示href属性所指向的网页资源。
定义好图像热点映射后,接着在<img>中增加一个名为usemap的属性设置, 格式:#加热点映射名,<img src="china.jpg" /> usemap="#mymap">
.txt{ border-botton: 1px solid #932093; color: #000; border-top: 0px; border-left: 0px; border-right: 0px; background-color: transparent;/*背景为透明*/}
文字为按钮:
.btn{ background-color: transparent; border: 0px;}
-----------------------------------------------------
鼠标在链接上显示不同的图片
a.help:hover{ cursor: help;}
-----------------------------------------------------
列表的符号的属性:
ul{ list-style-type: circle;}
列表的图片的属性:
ul{ list-style-image: url(icon1.jpg);}
菜单:
#nav ul{ list-style-type:none;}
横向下拉菜单
#nav ul{ list-style-type:none;}
#nav li{ float: left; /*把所有的菜单水平的显示*/}
-----------------------------------------------------
滤镜的使用IE(only)
alpha透明:filter:alpha(opacity=80);(透明)
blur模糊:filter:blurfilter:progd:DXImageTransform.Microsoft.blur(pixelradius=4, makeshadow=false);(模糊)
chroma去色:filter:chroma(color=#FF6800);(去色)color是希望去掉的颜色
Flip翻转:.filter:fliph (图片水平翻转).filter:flipv (图片竖直翻转).filter:flipv fliph (图片水平 and 竖直翻转)
mask遮罩:filter:mask(color=#bbccdd); (遮罩)(color是希望遮罩的颜色)
wave波浪:filter:wave(add=0,freq=2,lightstrength=70,phase=75,strength-4);
filter混合应用filter:flipv alpha(opacity=80) wave(add=0, freq=15, lightstrength=30,phase=0,strength=4);
-----------------------------------------------------
固定宽度并且居中
body{ text-align:center; (body中所以元素都居中)}
#containt{ position: relative; margin: 0 auto; (margin上下为零,左右自动调整) width:800px; tex-align: left;(覆盖body中text-align)}
-----------------------------------------------------
#nav li{ list-style-type: none; padding: **;
border-left: 1px solid white; display: inline; (建立水平导航条)}
#nav li:first-child{ border: none;}