// JavaScript Document //分页和上下篇开始 window.onload = function(){ //IE7分页去阴影 $("#AspNetPager1 a").removeAttr("disabled"); //返回顶部 $(".to_top").click(function () { $('html,body').animate({ scrollTop: '0px' }, 500); return false; }); //分页 $(".paginator a").each(function() { var atitle = $(this).attr('href'); if(atitle == ''|| atitle ==undefined) { }else{ $(this).addClass("sun_paging_hover"); } }); //上下篇 $(".sub_updown div a").each(function() { var atitle = $(this).attr('href'); if(atitle == ''|| atitle ==undefined) { }else{ $(this).parent().addClass("sub_updown_hover"); }; }); }; //分页和上下篇完成 //表单选择开始 $(function(){ //表单选择 $("input[type='text'],textarea").focus(function () { if ($(this).val() == "" || $(this).val() == this.defaultValue) { $(this).attr('cont',$(this).val()) $(this).attr("value", ""); } }); $("input[type='text'],textarea").blur(function () { if ($(this).attr("date") == undefined) { if ($(this).val() == "" || $(this).val() == $(this).attr("cont")) { $(this).attr("value", $(this).attr("cont")); } } }); }); //表单选择完成 //字体大小开始 //放大放小 var size = undefined; function doZoom() { var aa = $("#contentText"); if (size == undefined) { size = 16; } if (size == 14) { size = 16; } if (size == 12) { size = 14; } aa.css("font-size", size + "px"); aa.find("*").css("font-size", size + "px"); if (size == "12") { document.getElementById('contentText').style.lineHeight = "25px"; } else if (size == "14") { document.getElementById('contentText').style.lineHeight = "30px"; } else if (size == "16") { document.getElementById('contentText').style.lineHeight = "35px"; } } function doZoomj() { var aa = $("#contentText"); if (size == undefined) { size = 12; } if (size == 14) { size = 12; } if (size == 16) { size = 14; } aa.css("font-size", size + "px"); aa.find("*").css("font-size", size + "px"); if (size == "12") { document.getElementById('contentText').style.lineHeight = "25px"; } else if (size == "14") { document.getElementById('contentText').style.lineHeight = "30px"; } else if (size == "16") { document.getElementById('contentText').style.lineHeight = "35px"; } } //字体大小完成 //加入收藏和设为首页 begin //设为首页 function SetHome(url){ if (document.all) { document.body.style.behavior='url(#default#homepage)'; document.body.setHomePage(url); }else{ alert("您好,您的浏览器不支持自动设置页面为首页功能,请您手动在浏览器里设置该页面为首页!"); } } //加入收藏 function AddFavorite(sURL, sTitle) { sURL = encodeURI(sURL); try { window.external.addFavorite(sURL, sTitle); } catch (e) { try { window.sidebar.addPanel(sTitle, sURL, ""); } catch (e) { alert("加入收藏失败,请使用Ctrl+D进行添加,或手动在浏览器里进行设置."); } } } //加入收藏和设为首页 end $(document).ready(function(e) { $(".qlnomar6 li").each(function(index, element) { if(($(this).index()+1)%6==0){ $(this).css('margin-right','0px'); } }); $(".qlnomar5 li").each(function(index, element) { if(($(this).index()+1)%5==0){ $(this).css('margin-right','0px'); } }); $(".qlnomar4 li").each(function(index, element) { if(($(this).index()+1)%4==0){ $(this).css('margin-right','0px'); } }); $(".qlnomar3 li").each(function(index, element) { if(($(this).index()+1)%3==0){ $(this).css('margin-right','0px'); } }); }); //子页右侧内容最小高 if($('.sub_left').height()-116 < 490){ $('.content').css({'min-height':'490px'}); }else{ $('.content').css({'min-height':$('.sub_left').height()-116}); } //详细页保护色 $('.laiyuan div a').mouseenter(function(){ var xcolor=$(this).css('background-color'); $('.content').css({'background':xcolor}); }); $(document).ready(function () { var ceid = GetCookie("ceid"); var toid = GetCookie("toid"); var said = GetCookie("said"); var Object1 = $('[data-toid=' + toid + ']'); if (Object1) { Object1.addClass("hover"); } var Object2 = $('[data-ceid=' + ceid + ']'); if (Object2) { Object2.addClass("hover"); } var Object3 = $('[data-said=' + said + ']'); if (Object3) { Object3.addClass("hover"); } }); function GetCookie(sName) { var aCookie = document.cookie.split("; "); for (var i = 0; i < aCookie.length; i++) { var aCrumb = aCookie[i].split("="); if (sName == aCrumb[0]) return unescape(aCrumb[1]); } return null; }