Apr222016
Dec072012
Jul042012
jquery 限制图片大小
jQuery.fn.ImageAutoSize = function(width,height)
{
$("img",this).each(function()
{
var image = $(this);
if(image.width()>width)
{
image.width(width);
image.height(width/image.width()*image.height());
}
if(image.height()>height)
{
image.height(height);
image.width(height/image.height()*image.width());
}
});
}
//
$(function(){ $(".art_bod...阅读全文
Jun082012
jQuery定时器插件 jQuery Timers
jQuery Timers 是一个用来封装 setTimeout 和 setInterval 方法的 jQuery 定时器插件。
示例:
$("#close-button").click(function() {
$(this).oneTime(1000, function() {
$(this).parent(".main-window").hide();
});
});
$("#cancel-button").click(function() {
$("#close-button").stopTime();
});
阅读全文
Jun082012
jQuery心跳包插件 jHeartbeat
jHeartbeat 是一个jQuery 的插件,用来定时执行某项任务,例如定时向服务器发送请求;定时更新页面元素等等,特别适合用在聊天室开发上。
使用方法:
<script type=”text/javascript” src=”js/jquery.js”></script>
<script type=”text/javascript” src=js/jheartbeat.js”></script>
<script type=”text/javascript”>
$(document).ready(func...阅读全文
May072012
Apr232012
Js获取当前日期时间及其它操作(jquery)
var myDate = new Date();
myDate.getYear(); //获取当前年份(2位)
myDate.getFullYear(); //获取完整的年份(4位,1970-????)
myDate.getMonth(); //获取当前月份(0-11,0代表1月)
myDate.getDate(); //获取当前日(1-31)
myDate.getDay(); //获取当前星期X(0-6,0代表星期天)
myDate.getTime(); //获取当前时间(从1970.1.1开始的毫秒数)
myDate.getHours(); //获取当前小时数(0-23)
my...阅读全文
Apr232012
js日期选择控件-My97DatePicker
一. 简介
1. 简介
目前的版本是:4.8
2. 注意事项
My97DatePicker目录是一个整体,不可破坏里面的目录结构,也不可对里面的文件改名,可以改目录名
My97DatePicker.htm是必须文件,不可删除(4.8以后不存在此文件)
各目录及文件的用途:
WdatePicker.js 配置文件,在调用的地方仅需使用该文件,可多个共存,以xx_WdatePicker.js方式命名
config.js 语言和皮肤配置文件,无需引入(4.8以后合并入Wdate...阅读全文