第664章 国家利益高于一切 (第2/2页)
$(function(){
//导航切换事件
$("a#topDaoHang").toggle(function(){
//如果设置显示则隐藏
if($("#topNavBox").is(":visible")){
$("#topNavBox").hide();
}
$("div#topNavBoxTo").sho();
},function(){
$("div#topNavBoxTo").hide();
});
//但显示设置时 如果隐藏显示则隐藏
$("a.yuedushezhi").click(function(){
if($("div#topNavBoxTo").is(":visible")){
$("div#topNavBoxTo").hide();
}
});
//页面功能引导区
var userReadSet = getCookie("userReadSet");
if(!userReadSet){
setCookie("userReadSet",1,30);
}
//判断背景颜色设置 cookie是否保存 如果存在恢复设置
if(readSetBackground){
if(readSetBackground == 'rbgcloselight'){
$(".lilighttxet").text('开灯');
$("div#readercontainer").css("color","#666");
}else if(readSetBackground == 'rbgopenlight'){
$(".lilighttxet").text('关灯');
$("div#readercontainer").css("color","rgb(0, 0, 0)");
}
}
//判断文本字体大小设置 cookie是否保存 如果存在恢复设置
var readsetfontsize = getCookie("readsetfontsize");
if(readsetfontsize){
$("div#readercontainer").css("font-size",readsetfontsize+"px");
}
//判断文本行间距设置 cookie是否保存 如果存在恢复设置
var readsetlineheihgt = getCookie("readsetlineheihgt");
if(readsetlineheihgt){
$("div#readercontainer").css("line-height",readsetlineheihgt+"px");
}
//减小字体
$("#ddminus").click(function(){
var fontbody = $("div#readercontainer").css("font-size");
var fontsize = parseInt(fontbody);
if(fontsize > 16){
var nefont = eval(fontsize-2);
$("div#readercontainer").css("font-size",nefont+"px");
$("#ddplus").html("A+");
var fontbody = $("div#readercontainer").css("font-size");
var fontsize = parseInt(fontbody);
if(fontsize==16){
$("#ddminus").html("A");
}
//添加cookie记录
setCookie("readsetfontsize",nefont,30);
}
});
//增大字体
$("#ddplus").click(function(){
var fontbody = $("div#readercontainer").css("font-size");
var fontsize = parseInt(fontbody);
if(fontsize A-");
var fontbody = $("div#readercontainer").css("font-size");
var fontsize = parseInt(fontbody);
if(fontsize==28){
$("#ddplus").html("A");
}
//添加cookie记录
setCookie("readsetfontsize",nefont,30);
}
});
//行间距设置增大
$("#hang-xiao").click(function(){
var lineHeight = $("div#readercontainer").css("line-height");
var lineHeightNum = parseInt(lineHeight);
if(lineHeightNum >25){
var lineHN = eval(lineHeightNum-4);
$("div#readercontainer").css("line-height",lineHN+"px");
$("#hang-da").html("T+");
var lineHeight = $("div#readercontainer").css("line-height");
var lineHeightNum = parseInt(lineHeight);
if(lineHeightNum==22){
$("#hang-xiao").html("T");
}
//添加cookie记录
setCookie("readsetlineheihgt",lineHN,30);
}
});
//行间距设置减小
$("#hang-da").click(function(){
var lineHeight = $("div#readercontainer").css("line-height");
var lineHeightNum = parseInt(lineHeight);
if(lineHeightNum T-");
var lineHeight = $("div#readercontainer").css("line-height");
var lineHeightNum = parseInt(lineHeight);
if(lineHeightNum==46){
$("#hang-da").html("T");
}
//添加cookie记录
setCookie("readsetlineheihgt",lineHN,30);
}
});
//切换阅读背景颜色
$("d_bg dl span").each(function(index,element){
$(this).click(function(){
var backColorValue = $(this).attr('class');
$("body").removeClass();
$("body").addClass(backColorValue);
//添加cookie记录
setCookie("readSetBackground",backColorValue,30);
});
});
//切换关灯效果
$("div.book_title xet").toggle(function(){
$("#qiehuancss").attr('href',"-");
$("div#readercontainer").css("color","#666");
$(".lilighttxet").text('开灯');
//添加cookie记录
setCookie("readSetBackground","rbgcloselight",30);
},function(){
$("#qiehuancss").attr('href',"");
$("div#readercontainer").css("color","rgb(0, 0, 0)");
$(".lilighttxet").text('关灯');
//添加cookie记录
setCookie("readSetBackground","rbgopenlight",30);
});
$("#add_bookcase").click(function(){
var textContent = $(this).text();
var jquser = getCookie("jieqiUserInfo");
if(textContent == '加入书架'){
if(!jquser){
.href="";
return false;
}
var article_id = "97841";
var chapter_id = "2782369";
var page_ = pageidth();
var page_h = pageHeight();
var page_l = pageLeft();
var page_t = pageTop();
var dialog_ = parseInt(dth);
var dialog_h = parseInt();
var dialog_top = page_t + (page_h / 2) - (dialog_h / 2);
if(dialog_top (.+?)","igm");
var cc=(//g,"");
var str = xec(cc)[1];
str = ("style=\"idth:500px; margin-top:150px;\"","");
$("#dialog").css("display","block");
$("#dialog").css("top",dialog_top);
$("#dialog").css("left",dialog_left);
$("#dialogCN").html(str);
}