jQuery的ajax提交方式
作者:百事通 日期:2010-02-06
jQuery的验证插件Validate
作者:百事通 日期:2010-02-06
自己写的基于jQuery获取一定范围内多选框的值
作者:百事通 日期:2010-02-03
又是jQuery啦!!自己写的获取一定范围内多选框的值,返回值为数组,初步完善
/**
* 获取一定范围内ID,返回数组
* param.name 对象名称
* param.range 选取的范围
* get_ids({
name: 'ids[]',
range: 'myform'
})
*/
function get_ids(param)
{
var ids = [];
if(typeof(param.range) == 'object'){
param.range = $(param.range);
}else{
param.range = $('#'+param.range);
}
if(param.name == undefined){
param.name = 'ids[]';
}
$("input[name='"+param.name+"']", param.range).each(function(){
if($(this).attr("checked")==true){
ids.push(this.value);
}
});
return ids;
}
自己写的一个基于jQuery全选框函数
作者:百事通 日期:2010-02-03
因工作的需要,写了一个基于jQuery全选的函数,不足之处还有待完善
/**
* 全选
* param.range:选取的范围
* param.element:多选按钮对象(需在页面定义一个操作全选按钮),未定义默认为:ChkAll
* param.name:要选取多选框名称
* check_all({
name:'ids[]',
element:'ChkAll',
range:'myform'
})
*/
function check_all(param)
{
if(typeof(param.range) == 'object'){
param.range = $(param.range);
}else{
param.range = $('#'+param.range);
}
if(param.element == undefined){
param.element = $('#ChkAll');
}else{
if(typeof(param.element) == 'object'){
param.element = $(param.element);
}else{
param.element = $('#'+param.element);
}
}
if(param.element.attr('checked')==true){
$("input[name='"+param.name+"']", param.range).each(function(){
$(this).attr('checked', $(this).attr('checked')==true?false:true);
});
}else{
$("input[name='"+param.name+"']", param.range).each(function(){
$(this).attr('checked', false);
});
}
}
1980版太极张三丰(经典)
作者:百事通 日期:2010-02-03
jQuery弹出插件jqModal
作者:百事通 日期:2010-02-03
网址:http://dev.iceburg.net/jquery/jqModal
Functions
jqm
Initialize element(s) to be used as a jqModal. Accepts a parameters object. If element(s) are already initialized, the call will update their parameters.
$('#dialog').jqm();
$('.dialogs').jqm({ajax:'@href',modal:true});
jqmShow
Show jqModal element(s).
$('#dialog').jqmShow();
$('.dialogs').jqmShow();
jqmHide
Hide jqModal element(s).
$('#dialog').jqmHide();
$('.dialogs').jqmHide();
jqmAddTrigger
Adds the passed element(s) as a "show" trigger. Clicking them will show the jqModal. Accepts;
* (string) A jQuery Selector
* (object) A jQuery Collection
* (object) A DOM element
$('#dialog').jqmAddTrigger('.openDialog');
$('.dialogs').jqmAddTrigger($('#openDialogs a'));
jqmAddClose
Adds the passed element(s) as a "close" trigger. Clicking them will hide the jqModal. Accepts;
* (string) A jQuery Selector
* (object) A jQuery Collection
* (object) A DOM element
$('#dialog').jqmAddClose('.hideDialog');
$('.dialogs').jqmAddClose($('#hideDialogs a'));
用CSS来实现图片自适应大小
作者:百事通 日期:2010-01-28
div img {
max-width:600px;
width:600px;
width:expression(document.body.clientWidth>600?"600px":"auto");
overflow:hidden;
}
max-width:600px; IE7、FF等其他非IE浏览器下最大宽度为600px。但在IE6中无效。
width:600px; 在所有浏览器中图片的大小为600px;
当图片大小大于600px,自动缩小为600px。在IE6中有效。
overflow:hidden; 超出的部分隐藏,避免控制图片大小失败而引起的撑开变形。
Mozilla建议的CSS书写顺序
作者:百事通 日期:2010-01-28
* maintained by fantasai
* (classes defined in the Markup Guide - http://mozilla.org/contribute/writing/markup)
*/
/* Suggested order:
//显示属性
* display
* list-style
* position
* float
* clear
//自身属性
* width
* height
* margin
* padding
* border
* background
//文本属性
* color
* font
* text-decoration
* text-align
* vertical-align
* white-space
* other text
* content
*
*/







