var username; function set_title(id){ var user_id = readCookie('zz_userid'); var user_id = parseInt(user_id); username = $('#username').val(); if(!user_id){ alert('会员请先登录!'); location.href="/dom/denglu.php?username="+username; return false; } $('#thread_id').val(id); showDiv(); } //颜色 var myCP1; function initColorPicker(id) { var myCP1 = new dhtmlXColorPickerInput(id); myCP1.setImagePath("/msg/codebase/imgs/"); myCP1.init(); } function showDiv(){ var allzz = document.getElementById("allzz2"); var Alert = document.getElementById("Alert2"); //alert(document.body.offsetHeight); //alert(document.body.offsetWidth); //alert(document.body.scrollTop); //alert(document.scrollTop); allzz.style.height = document.body.offsetHeight +"px"; allzz.style.width = document.body.offsetWidth +"px"; allzz.style.display = "block"; Alert.style.display = "block"; if(document.body.scrollTop){ var bodyscroll = document.body.scrollTop; }else{ var bodyscroll = document.documentElement.scrollTop; } Alert.style.top = bodyscroll + (document.documentElement.clientHeight - Alert.offsetHeight)/2 + "px"; //Alert.style.left = (document.body.offsetWidth/2)- (Alert.offsetWidth/2) + "px"; } function hideDiv(){ var allzz = document.getElementById("allzz2"); var Alert = document.getElementById("Alert2"); allzz.style.display = "none"; Alert.style.display ="none"; } function set_title_btn(){ var id = $('#thread_id').val(); var color = $('#gly_color').val(); var is_weight =$("input[name=is_weight]:checked").val(); $.ajax({ type:'post',//可选get url:'/dom/action/handle_thread_title.php?username='+username, data:{'id':id,'color':color,'is_weight':is_weight}, dataType:'json', success:function(msg){ if(msg==1){ alert('设置成功'); var rs = (is_weight==1) ? 'bolder':'normal'; $('#list_'+id).css({"color":color,'font-weight':rs}); hideDiv(); } } }) }