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對象(國際標準時間)css

var cookie_expires = new Date(); html

 

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();
相關文章
相關標籤/搜索