function checkNumber(event,objThis)
{
var eventKey = document.all ? event.keyCode : event.which;
if(!(eventKey>=48&&eventKey<=57) && eventKey != 8 )
return false;
}
<input type="text" size="4" maxlength="4" value="2" name="count" onkeypress="return checkNumber(event,this);">
Archive for 十一月, 2010
eventKey code
text-indent 隐藏按钮文字
1: HTML Code
Create a HTML page and insert a button with a class, “button”. (continue reading…)
ie6 下 jquery的 submit不起作用
- 问题:
- 项目中所有使用jquery.submit()的方法在验证后提交在ie6中失去作用;
- 所有使用window.location.href=*** 方法在验证后在ie6中失去作用;
- 所有a链接中使用href=”javascript:void(0);”方法后在i6中点击失去使用;
- (失去作用意思为:点击后已经到后台取到值但页面并没有更新) (continue reading…)
浏览器对 ‘@font-face’ 规则支持的字体格式不同
标准参考
根据 CSS3 草案中的描述,’@font-face’ 规则允许使用链接到需要时自动激活的字体。这使得用户可以使用在线的字体,而不仅仅拘泥于使用用户端系统内的字体。一套对字体的描述定义了字体资源的位置,可以是本地也可以是其他地方,以及自定义个性化字体风格。
规则定义格式:
@font-face {
descriptor: value;
descriptor: value;
[...]
descriptor: value;
} (continue reading...)
Google Font API
http://code.google.com/intl/zh-CN/apis/webfonts/
The Google Font API helps you add web fonts to any web page.
Benefits of the Google Font API include:
- A choice of high quality open source fonts.
- Works in most browsers.
- Extremely easy to use.
For example, the following text uses a web font called Tangerine:
Making the Web Beautiful!
Applying a font is easy: just add a special stylesheet link to your web page, then use the font in a CSS style.
For details, see the quick start example.
