smartFocus
- 授权协议: 未知
- 开发语言:
- 操作系统: 未知
- 软件首页: http://plugins.jquery.com/project/smartFocus
软件介绍
A small plugin to inject a text into inputs ortextareas as a label.
The text is removed when the element is focused and re-injected onblur if the element is leaved blank.
Here is the code to include in an external js or to paste on the page:
jQuery.fn.smartFocus = function(text) {
$(this).val(text).focus(function(){
if($(this).val() == text){
$(this).val('');
}
}).blur(function(){
if( $(this).val() == '' ){
$(this).val(text);
}
});
};
USAGE EXAMPLE:
var mail = '* E-mail';
$('#mail').smartFocus(mail);
This will inject the text "* E-mail" into the element (an input or a textarea) with id='mail'
Grab
精通JavaScript+jQuery
曾顺 编著 / 人民邮电出版社 / 2008-9 / 59.00元
随着Ajax技术的不断风靡,其核心技术JavaScript越来越受到人们的关注,各种JavaScript的框架层出不穷。jQuery作为JavaScript框架的优秀代表,为广大开发者提供了诸多便利。 本书从介绍JavaScript的基础知识开始,围绕标准Web的各项技术予以展开,通过大量实例对JavaScript、CSS、DOM、Ajax等 Web关键技术进行深入浅出的分析,主要内容包括J......一起来看看 《精通JavaScript+jQuery》 这本书的介绍吧!
