// 顶部获取日期
function newDate(){ var today=new Date(); var d=new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
var nian = getYear(today)+"年"+(today.getMonth()+1)+"月" +today.getDate()+"日"; var datetimeNode = document.getElementById("datetimeNode");
var oDiv = document.createElement("span");
oDiv.innerHTML=nian+' '+d[today.getDay()];
datetimeNode.appendChild(oDiv);}
//12.移动端顶部点击弹出下拉菜单
function Menu(menu,main){
var onOff = true;
$(menu).bind('click',function (){ //绑定this为menu
$(main).slideToggle();
if($(this).find('span').hasClass('fa-navicon')){
$(this).closest('li').find('.subNavs').slideUp();
$(this).find('span').removeClass('fa-navicon');
$(this).find('span').addClass('fa-remove');
}else{
$(this).find('span').addClass('fa-navicon');
$(this).find('span').removeClass('fa-remove');
}
})
$(main).find('li > span').bind('click',function (){
if($(this).hasClass('fa-chevron-right')){
$(this).removeClass('fa-chevron-right');
$(this).addClass('fa-chevron-down');
}else{
$(this).addClass('fa-chevron-right');
$(this).removeClass('fa-chevron-down');
}
if($(this).parent().hasClass('on')){
$(this).parent().find('.subNavs').slideUp();
$(this).parent().removeClass('on');
return false; //退出循环
};
$(this).parent().siblings().removeClass('on').find('.subNavs');
$(this).closest('li').siblings().find('.subNavs').slideUp();
$(this).parent().addClass('on').find('.subNavs');
$(this).parent().find('.subNavs').slideDown();
})
};
//字号大小
function FontSize2(Size,obj){
var iNum = 14;
$(Size).find('.max').bind('click',function (){
iNum+=2;
if(iNum>=24){
iNum = 24;
}
$(obj).css('font-size',iNum + 'px');
return iNum;
})
$(Size).find('.mid').bind('click',function (){
iNum = 14;
$(obj).css('font-size',iNum + 'px');
return iNum;
})
$(Size).find('.min').bind('click',function (){
iNum-=2;
if(iNum<=12){
iNum = 12;
}
$(obj).css('font-size',iNum + 'px');
return iNum;
})
};
// 弹出新窗口打印
function doPrint() {
bdhtml=window.document.body.innerHTML;
sprnstr="";
eprnstr="";
prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);
prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
OpenWindow = window.open("");OpenWindow.document.write("
打印页面<\/TITLE><\/HEAD><\/div><\/BODY><\/HTML>");OpenWindow.document.getElementById("printbox").innerHTML=prnhtml;OpenWindow.document.close();OpenWindow.print();}
/*打印区的内容一定要加和标记*/
//下拉菜单JS
function nav(){
var oNav = document.getElementById('nav');
var aLi = oNav.getElementsByTagName('li');
for(var i=0;i
= count) return;
$("#banner_info").html($("#banner_list a").eq(i).find("img").attr('alt'));
$("#banner_info").unbind().click(function(){window.open($("#banner_list a").eq(i).attr('href'), "_blank")})
$("#banner_list a").filter(":visible").fadeOut(1000).parent().children().eq(i).fadeIn(1000);
document.getElementById("bannerPic").style.background="";
$(this).toggleClass("on");
$(this).siblings().removeAttr("class");
});
t = setInterval(showAuto, 3000);
$("#bannerPic").hover(function(){clearInterval(t)}, function(){t = setInterval(showAuto, 3000);});
})
function showAuto()
{
n = n >=(count - 1) ? 0 : ++n;
$("#bannerPic li").eq(n).trigger('click');
}
}
/*--------------------图片区--------------------------*/
var shu=0;
$('.pic ol li').mouseover(function(e) {
shu+=1
$(this).addClass('active').siblings().removeClass();
$('#zz li').eq($(this).index()).css('z-index',shu).hide().fadeIn(800)
});
/*--------------------图片区--------------------------*/
function DY_scroll(wraper,prev,next,img,speed,or)
{ var wraper = $(wraper);
var prev = $(prev);
var next = $(next);
var img = $(img).find('ul');
var w = img.find('li').outerWidth(true);
var s = speed;
wraper.mouseover(function (){
prev.css('display','block'); next.css('display','block');
})
wraper.mouseout(function (){
prev.css('display','none'); next.css('display','none');
})
next.click(function()
{
img.animate({'margin-left':-w},function()
{
img.find('li').eq(0).appendTo(img);
img.css({'margin-left':0});
});
});
prev.click(function()
{
img.find('li:last').prependTo(img);
img.css({'margin-left':-w});
img.animate({'margin-left':0});
});
if (or == true)
{
ad = setInterval(function() { next.click();},s*1000);
wraper.hover(function(){clearInterval(ad);},function(){ad = setInterval(function() { next.click();},s*1000);});
}
}
DY_scroll('.imgs_scroll','.prev','.next','.imgs_news_list',3,false);// true为自动播放,不加此参数或false就默认不自动
function topLink() {
$("#subColumnpic").click(function(){
$("#subColumbox").toggle(300);
});
};
//大图切换高度问题
function ImgHeight(){
// var oSlider = document.getElementById('slider');
// var aLiSlider = oSlider.getElementsByTagName('img');
window.onload = function (){
var iHeight = document.documentElement.clientWidth * (400/1920);
$('.rslides,.caption,.wz_caption').css('height',iHeight+'px');
window.onscroll = window.onresize = function (){
var iHeight = document.documentElement.clientWidth * (400/1920);
$('.rslides,.caption,.wz_caption').css('height',iHeight+'px');
}
}
}