“小沈阳”版设计师

By 愚人码头, 2009年07月3日 1:17 下午

1.做图其实可痛苦的了……设计一做一改,一天就过去了;嚎~设计再一改一调,整个晚上就过去了;嚎~
2.做图最痛苦的事儿是啥,知道不?就是,图没做完,设计又改了;
3.做图最最痛苦的事儿是啥,知道不? 就是,图好不容易做完了,方案全改了;
4.做图最最最痛苦的事儿是啥,知道不? 就是,图做完了,狗日的客户跑了;
5.做图最最最最最痛苦的事儿是啥,知道不? 就是,狗日的客户又回来了,图给删没了;

js对输入框的字数限制

By 愚人码头, 2009年07月2日 8:34 下午

js对输入框的字数限制,限制文本框输入的字符数,若达到数目则停止其输入!代码如下:

提示:你可以先修改部分代码再运行。

几个实用的JavaScript自定义函数

如果你写js有一段时间了,你会发现有些代码我们需要经常的写,重复的写,我是一个比较懒的人,所以我会经常整理一些常用的好用的自定义函数,废话不说了,看我的poc.

提示:你可以先修改部分代码再运行。

除了会用这些函数外,其实最重要的是学习代码中的一些写法,这些函数看上去很短很简单,但对新手来说,想自己写出来还是有点难度的.总之,动手+思考+动手+思考+动手+思考+动手+思考+动手+思考..

Javascript学习(1)

1 , javascript字符集: 

javascript采用的是Unicode字符集编码。 

为什么要采用这个编码呢? 

原因很简单,16位的Unicode编码可以表示地球人的任何书面语言。这是语言 国际化的一个重要特征。(大家也许见过用中文写脚本,比如:function 我的函数() {} );

Javascript中每个字符都是用2个字节表示的。(因为是16位编码)

2 ,大小写敏感: 

js是一种区分大小写的语言。 

注意下:以前我也犯过的错误。 

HTML是不区分大小写的。经常看见有人这么写,

<input type=”button” onClick=”a()” /> (这样写是对的) 

如果放到JS中,就必须使用onclick(小写哦!) 

同时XHTML中也只能使用小写。 

这个我们并不需要太关心,象这种问题,其实都可以自己给自己定一个标准,自己写程序的时候全部小写。 

另外每行程序后 分号 也是一样,我们都写上。

Continue reading 'Javascript学习(1)'»

slideUp 和 slideDown 一起的用法和效果

/*//点击层#faq里的dd显示dt内容,做点则隐藏
 $(function(){
  $(”#faq”).find(”dd”).hide().end().find(”dt”).click(function(){
   var answer = $(this).next();
   if(answer.is(”:visible”)){
    answer.slideUp();
   }else {
    answer.slideDown();
   }
  })
 })

html代码

<div id=”faq”>
 <dl>
     <dt>123132</dt>
        <dd style=”display:none”>12312</dd>
       
        <dt>123132</dt>
        <dd style=”display:none”>12312</dd>
    </dl>
</div>

addClass和removeClass 一起的用法!

//鼠标移到a显示样式b移去去除样式b
 $(function(){
  $(”a”).hover(function(){
   $(this).parents(”p”).addClass(”b”);
  },
  function(){
   $(this).parents(”p”).removeClass(”b”);
  })
 })

html代码

<style>
 .b {background-color:#f6f6f6;}
</style>

<p><a href=”#”> 123</a></p>

<p><a href=”#”> 123</a></p>

<p><a href=”#”> 123</a></p>

<p><a href=”#”> 123</a></p>

JavaScript中的CSS属性对照表(新手必备)

By 愚人码头, 2009年07月1日 11:40 下午

JavaScript中的CSS属性对照表是js初学者必备的基础知识

盒子标签和属性对照
CSS语法 (不区分大小写) JavaScript语法 (区分大小写)
border border
border-bottom borderBottom
border-bottom-color borderBottomColor
border-bottom-style borderBottomStyle
border-bottom-width borderBottomWidth
border-color borderColor
border-left borderLeft
border-left-color borderLeftColor
border-left-style borderLeftStyle
border-left-width borderLeftWidth
border-right borderRight
border-right-color borderRightColor
border-right-style borderRightStyle
border-right-width borderRightWidth
border-style borderStyle
border-top borderTop
border-top-color borderTopColor
border-top-style borderTopStyle
border-top-width borderTopWidth
border-width borderWidth
clear clear
float floatStyle
margin margin
margin-bottom marginBottom
margin-left marginLeft
margin-right marginRight
margin-top marginTop
padding padding
padding-bottom paddingBottom
padding-left paddingLeft
padding-right paddingRight
padding-top paddingTop
颜色和背景标签和属性对照
CSS语法 (不区分大小写) JavaScript语法 (区分大小写)
background background
background-attachment backgroundAttachment
background-color backgroundColor
background-image backgroundImage
background-position backgroundPosition
background-repeat backgroundRepeat
color color
样式标签和属性对照
CSS语法 (不区分大小写) JavaScript语法 (区分大小写)
display display
list-style-type listStyleType
list-style-image listStyleImage
list-style-position listStylePosition
list-style listStyle
white-space whiteSpace
文字样式标签和属性对照
CSS语法 (不区分大小写) JavaScript语法 (区分大小写)
font font
font-family fontFamily
font-size fontSize
font-style fontStyle
font-variant fontVariant
font-weight fontWeight
文本标签和属性对照
CSS语法 (不区分大小写) JavaScript语法 (区分大小写)
letter-spacing letterSpacing
line-break lineBreak
line-height lineHeight
text-align textAlign
text-decoration textDecoration
text-indent textIndent
text-justify textJustify
text-transform textTransform
vertical-align verticalAlign

第一篇

纪念

[顶] 再次领悟正则表达式

今天做网页的时候,又碰了正则表达式的问题

——[REVERT=laoshu133 于 2008-11-25 14:59:58 回复]呵呵[/REVERT]
对上句内容的匹配,我一开始是这么写的:

oReg.Pattern=”\[\/REVERT\]”
str=oReg.Replace(str,”</div>”)
oReg.Pattern=”\[REVERT\=(.+)\]”
re_revert=oReg.Replace(str,”<div class=”"guest_rev”"><blockquote>$1</blockquote>”)

测试时没一点问题,可是后来我一向不对啊~
那万一我要回复两次呢?那么要匹配的内容就变成:
——[REVERT=laoshu133 于 2008-11-25 14:59:58 回复]回复测试[/REVERT][REVERT=laoshu133 于 2008-11-25 14:59:58 回复]二次回复测试[/REVERT]
然而,现在问题来了,按我上面写的去全局匹配,就变成: Continue reading '[顶] 再次领悟正则表达式'»

Panorama theme by Themocracy