jquery实用方法

$(document).bind("click",function(e){
//class为phone-show的是菜单,id为go_phone的是打开菜单的按钮            
if($(e.target).closest(".phone-show").length == 0 && $(e.target).closest("#go_phone").length == 0){
         //点击phone-show之外的区域且id不是go_phone,则执行下面的程序
                web.utility.hideLayerModal();
                $(document.body).css({
                "overflow-y":"scroll"
                });
        }
});

 

$('.article-title').bind('input propertychange',function(){ //实时监听input输入内容,并作出相应处理
var title = $(this).val();
        $('.contribute-header h1').html(title);
});   

 

//获取下个月1号00:00点的date对象(国际标准时间)

var cookie_expires = new Date(); 

 

var year = cookie_expires.getFullYear();

 

var current_month = cookie_expires.getMonth()+1;
var next_month = current_month+1;
if(current_month==12){
next_month = 1;
year++;
}
cookie_expires.setMonth(next_month-1);
cookie_expires.setDate(1);
cookie_expires.setHours(0);
cookie_expires.setMinutes(0);
cookie_expires.setTime(cookie_expires.getTime());
var dateTime = year+'/'+(cookie_expires.getMonth()+1)+'/'+(cookie_expires.getDate())+ ' 8:00:00';
cookie_expires = new Date(Date.parse(dateTime)).toUTCString();
posted @ 2016-05-23 18:32  lixiaodi  阅读(99)  评论(0编辑  收藏  举报