var f = true
$(function(){
var int = true;
$(".z_menulist").css({display:'block',height:'400px'});
$(".z_typelist").addclass('z_typelisthover');
int = setinterval(function(){
$(".z_menulist").css({display:'none',height:'0'});
$(".z_typelist").removeclass('z_typelisthover');
},5000)
//clearinterval(int)
$("#z_typelist").hover(function(){
clearinterval(int)
},function(){
$(".z_menulist").css({display:'none',height:'0'});
$(".z_typelist").removeclass('z_typelisthover');
})
$('ul.z_menulist_ul>li').each(function(this){
$(this).hover(function(){
if(parseint($('header').width())>=1190){
w=true;
}else{
w=false;
}
nvw=w?980:530;
$('.z_sublist').addclass('box-shadow').css({'display': 'block'}).animate({'width': nvw},0);
if(f){
$('.subview').eq(this).css({'display': 'block'}).animate({'width': nvw},0);
}
f=false;
})
})
})
//������ŀ����
$(function() {
var bbtn = false;
var bw=false;
var navw=0;
$('#z_typelist').hover(function() {
$('.z_menulist').queue(function(next) {
$(this).css({
'display': 'block',
});
next();
}).animate({
'height': '+=400px'
},
100,
function() {
$('ul.z_menulist_ul>li').each(function() {
$(this).hover(function() {
$(this).queue(function(next) {
var ins = $(this).index();
$('.subview').css({
'width': 0,
'display': 'none'
});
function tonavw(){
if (!bbtn) {
if(parseint($('header').width())>=1190){
bw=true;
}else{
bw=false;
}
navw=bw?980:530;
$('.z_sublist').addclass('box-shadow');
$('.z_sublist').css({
'display': 'block'
}).animate({
'width': navw
},0);
$('.subview').eq(ins).css({
'display': 'block'
}).animate({
'width': navw
},
function() {
bbtn = true;
},0);
} else {
$('.subview').eq(ins).css({
'display': 'block'
}).animate({
'width': navw
},
0);
}
}
tonavw();
$(document).bind('ready',tonavw);
$(window).bind('resize',function(){
$(document).unbind('ready',tonavw);
$(document).bind('ready',tonavw);
});
next();
});
});
});
});
},
function() {
$(this).queue(function(next) {
bbtn = false;
$(this).find('.z_menulist').stop().css({
'height': 0,
'display': 'none'
});
$('.subview').css({
'width': 0,
'display': 'none'
});
$('.z_sublist').removeclass('box-shadow');
$('.z_sublist').css({
'width': 0,
'display': 'none'
});
next();
});
});
});
$(document).ready(function(){
$(".list-item0,#subview0").mouseover(function(){
$(".list-item0").addclass("alt");
});
$(".list-item0,#subview0").mouseout(function(){
$(".list-item0").removeclass("alt");
});
$(".list-item1,#subview1").mouseover(function(){
$(".list-item1").addclass("alt");
$(".list-item0 .list-xian").hide();
});
$(".list-item1,#subview1").mouseout(function(){
$(".list-item1").removeclass("alt");
$(".list-item0 .list-xian").show();
});
$(".list-item2,#subview2").mouseover(function(){
$(".list-item2").addclass("alt");
$(".list-item1 .list-xian").hide();
});
$(".list-item2,#subview2").mouseout(function(){
$(".list-item2").removeclass("alt");
$(".list-item1 .list-xian").show();
});
$(".list-item3,#subview3").mouseover(function(){
$(".list-item3").addclass("alt");
$(".list-item2 .list-xian").hide();
});
$(".list-item3,#subview3").mouseout(function(){
$(".list-item3").removeclass("alt");
$(".list-item2 .list-xian").show();
});
$(".list-item4,#subview4").mouseover(function(){
$(".list-item4").addclass("alt");
$(".list-item3 .list-xian").hide();
});
$(".list-item4,#subview4").mouseout(function(){
$(".list-item4").removeclass("alt");
$(".list-item3 .list-xian").show();
});
$(".list-item5,#subview5").mouseover(function(){
$(".list-item5").addclass("alt");
$(".list-item4 .list-xian").hide();
});
$(".list-item5,#subview5").mouseout(function(){
$(".list-item5").removeclass("alt");
$(".list-item4 .list-xian").show();
});
$(".list-item6,#subview6").mouseover(function(){
$(".list-item6").addclass("alt");
$(".list-item5 .list-xian").hide();
});
$(".list-item6,#subview6").mouseout(function(){
$(".list-item6").removeclass("alt");
$(".list-item5 .list-xian").show();
});
$(".list-item7,#subview7").mouseover(function(){
$(".list-item7").addclass("alt");
$(".list-item6 .list-xian").hide();
});
$(".list-item7,#subview7").mouseout(function(){
$(".list-item7").removeclass("alt");
$(".list-item6 .list-xian").show();
});
$(".list-item8,#subview8").mouseover(function(){
$(".list-item8").addclass("alt");
$(".list-item7 .list-xian").hide();
});
$(".list-item8,#subview8").mouseout(function(){
$(".list-item8").removeclass("alt");
$(".list-item7 .list-xian").show();
});
$(".list-item9,#subview9").mouseover(function(){
$(".list-item9").addclass("alt");
$(".list-item8 .list-xian").hide();
});
$(".list-item9,#subview9").mouseout(function(){
$(".list-item9").removeclass("alt");
$(".list-item8 .list-xian").show();
});
});
(function($) {
$.fn.extend({
//����ч����װ
nav:function() {
this.hover(function() {
$(this).stop().animate({
'top': -$(this).height() / 2
},
300);
},
function() {
$(this).stop().animate({
'top': 0
},
300);
});
},
})
})(jquery);
//bannerч����װ
(function($) {
$.fn.banner = function(o) {
$.extend({
time: 400,
animstyle: true,
addclass:addclass
},
o || {});
var inow = 0;
var timer = null;
var odiv = $(this);
var oul = odiv.children('ul');
var ali = $('li', oul);
var onesize = ali.eq(0).width();
var animstyle = o.animstyle ? 'left': 'opacity';
var addclass=o.addclass;
//alert(onesize);
var time = o.time;
odiv.css({
'position': 'relative'
});
$('
').appendto(odiv);
var bannerindex = $('.banner_index ul', odiv);
ali.each(function(i) {
if (animstyle == 'opacity') {
if ($(this).index() == 0) {
$(this).css({
'opacity': 1,
'z-index':1
});
} else {
$(this).css({
'opacity': 0
});
}
$(this).css({
'position': 'absolute',
'left': 0,
'top': 0
});
} else {
oul.css({
'width': onesize * ali.size(),
'position': 'absolute',
'left': 0
});
}
$('').appendto(bannerindex);
//console.log(odiv.width() + '||' + $(this).index() + '||' + onesize);
});
$('li', bannerindex).css({
'background-image': 'url(hm_images/banner_index_white.png)',
});
$('li', bannerindex).eq(inow).css({
'background-image': 'url(hm_images/banner_index_red.png)'
});
ali.eq(inow).addclass(addclass);
var _this = ali;
function fnnext(inow) {
_this.eq(inow).addclass(addclass).siblings('li').removeclass(addclass);
$('li', bannerindex).eq(inow).css({
'background-image': 'url(hm_images/banner_index_red.png)'
}).siblings('li').css({
'background-image': 'url(hm_images/banner_index_white.png)'
});
if (!o.animstyle) {
for (var i = 0; i < _this.length; i++) {
if (i > inow) {
_this.eq(i).stop(true, true).animate({
'opacity': 0,
'z-index':0,
},
time);
} else if (i < inow) {
_this.eq(i).stop(true, true).animate({
'opacity': 0,
'z-index':0,
},
time);
} else {
_this.eq(i).stop(true, true).animate({
'opacity': 1,
'z-index':1,
},
time);
}
}
} else {
oul.stop().animate({
'left': -inow * onesize
});
}
}
timer = setinterval(function() {
if (inow == _this.length - 1) {
inow = 0
} else {
inow++;
}
fnnext(inow);
},
7000);
$('li', bannerindex).each(function() {
$(this).mouseover(function() {
clearinterval(timer);
inow = $(this).index();
fnnext(inow);
});
$(this).mouseout(function() {
clearinterval(timer);
timer = setinterval(function() {
if (inow == _this.length - 1) {
inow = 0
} else {
inow++;
}
fnnext(inow);
},
7000);
});
});
}
})(jquery);
//��ťbanner
$(function() {
//var swidth = $("#focusindex").width(); //��ȡ����ͼ�ŀ�ȣ���ʾ�����
var len = $("#focusindex ul li").length; //��ȡ����ͼ����
var index = 0;
var pictimer;
//���´���������ְ�ť�ͱ�ť��i�������������һҳ����һҳ������ť
var btn = "";
for(var i=0; i < len; i++) {
btn += "";
}
btn += "
";
$("#focusindex").append(btn);
//ϊс��ť�����껬���¼�������ʾ��ӧ������
$("#focusindex .btn span").css("opacity",1).mouseover(function() {
index = $("#focusindex .btn span").index(this);
showpics(index);
}).eq(0).trigger("mouseover");
//��һҳ����һҳ��ť���ȴ���
/* $("#focusindex").hover(function() {
$("#focusindex .pre").animate({"left":"10%","opacity":"1"},300);
$("#focusindex .next").animate({"right":"10%","opacity":"1"},300);
},function() {
$("#focusindex .pre").animate({"left":"0%","opacity":"0"},300);
$("#focusindex .next").animate({"right":"0%","opacity":"0"},300);
});*/
//��һҳ��ť
$("#focusindex .pre").click(function() {
index -= 1;
if(index == -1) {index = len - 1;}
showpics(index);
});
//��һҳ��ť
$("#focusindex .next").click(function() {
index += 1;
if(index == len) {index = 0;}
showpics(index);
});
//ipai
$("#focusindex").on("swiperight",function(){
index -= 1;
if(index == -1) {index = len - 1;}
showpics(index);
});
$("#focusindex").on("swipeleft",function(){
index += 1;
if(index == len) {index = 0;}
showpics(index);
});
//����ϊ���ҹ�����������liԪ�ض�����ͬһ������������������ҫ�������χulԪ�صŀ��
//$("#focusindex ul").css("width",swidth * (len));
//��껬�ͻ���ͼʱֹͣ�զ����ţ�����ʱ��ʼ�զ�����
$("#focusindex").hover(function() {
clearinterval(pictimer);
},function() {
pictimer = setinterval(function() {
showpics(index);
index++;
if(index == len) {index = 0;}
},3000); //��4000�����զ����ŵļ�����λ������
}).trigger("mouseleave");
//��ʾͼƭ���������ݽ��յ�indexֵ��ʾ��ӧ������
function showpics(index) { //��ͨ�л�
//var nowleft = -index*swidth; //����indexֵ����ulԪ�ص�leftֵ
//$("#focusindex ul").stop(true,false).animate({"left":nowleft},300); //ͨ��animate()����ulԪ�ع������������position
//$("#focusindex .btn span").removeclass("on").eq(index).addclass("on"); //ϊ��ǰ�i�ť�л���ѡ�е�ч��
$("#focusindex .btn span").stop(true,false).removeclass("on").eq(index).stop(true,false).addclass("on"); //ϊ��ǰ�i�ť�л���ѡ�е�ч��
$("#focusindex ul li").stop(true,false).animate({"opacity":"0"},1500).css("z-index",0).removeclass("bannerdh").eq(index).stop(true,false).animate({"opacity":"1"},1500).addclass("bannerdh").css("z-index",1); //ϊ��ǰ�i�ť�л���ѡ�е�ч��
}
});
//�ַ���ч��
(function($) {
$.fn.shoufq = function(o) {
o = $.extend({
anibeforewidth: '0',
aniafterwidth: '0'
},
o);
var _this = this;
var abw = o.anibeforewidth;
var aaw = o.aniafterwidth;
var v = o.anistyle;
return _this.each(function() {
$(this).mouseover(function() {
$(this).stop().animate({
width: aaw
},
300).siblings().stop().animate({
width: abw
},
300);
});
});
}
})(jquery);
$(function() {
//�˵�ч��
$('.mbox1>ul>li').each(function() {
$(this).hover(function(){
$('.mbox1 .move_bg').remove();
var odiv=$("");
odiv.insertbefore($(this).children('a'));
var omove=$(this).find('.move_bg');
omove.animate({'left':20},280,function(){
omove.animate({'left':0},280);
})
},function(){
$('.mbox1 .move_bg').remove();
});
});
//banner
//$('.section_banner1_box').banner({time:400,animstyle:false,addclass:'bannerdh'});
//������ŀbanner
$('.object_banner1').banner({time:600,animstyle:true});
$('.object_banner2').banner({time:600,animstyle:true});
$('.object_banner3').banner({time:600,animstyle:true});
$('.object_banner4').banner({time:600,animstyle:true});
$('.object_banner5').banner({time:600,animstyle:true});
//ר��
$('.focuszjimg').banner({time:400,animstyle:false});
//ר��ҳ
$('#ztbox1c').banner({time:400,animstyle:false});
$('.s4_box1_into').nav();
})
$(function(){
//��������
function fnnice(){
if(parseint($('.s4_box1').width())>=1200){
$('.s4_c_in').shoufq({anibeforewidth:'222px',aniafterwidth: '736px'});
}else{
$('.s4_c_in').shoufq({anibeforewidth:'222px',aniafterwidth: '736px'});
}
}
fnnice();
$(window).bind('resize',function(){
if(parseint($('.s4_box1').width())>=1200){
$('.s4_c_in').css({width:222});
$('.s4_c_in').first().css({width:736});
}else{
$('.s4_c_in').css({width:222});
$('.s4_c_in').first().css({width:736});
}
fnnice();
})
})
//��������
$(function(){
$(".qmfdj").click(function(){
var _this = $(this);//����ǰ��pimgԪ����ϊ_this���뺯��
imgshow("#outerdiv", "#innerdiv", "#bigimg", _this);
});
});
function imgshow(outerdiv, innerdiv, bigimg, _this){
var src = _this.attr("src");//��ȡ��ǰ�����pimgԪ���е�src����
$(bigimg).attr("src", src);//����#bigimgԪ�ص�src����
/*��ȡ��ǰ���ͼƭ����ʵ��с������ʾ�����㼰��ͼ*/
$("").attr("src", src).load(function(){
var windoww = $(window).width();//��ȡ��ǰ���ڿ��
var windowh = $(window).height();//��ȡ��ǰ���ڸ߶�
var realwidth = this.width;//��ȡͼƭ��ʵ���
var realheight = this.height;//��ȡͼƭ��ʵ�߶�
var imgwidth, imgheight;
var scale = 0.8;//���ųߴ磬��ͼƭ��ʵ��ⱥ߶ȴ��ڴ��ڿ�ⱥ߶�ʱ��������
if(realheight>windowh*scale) {//�ж�ͼƭ�߶�
imgheight = windowh*scale;//����ڴ��ڸ߶ȣ�ͼƭ�߶ƚ�������
imgwidth = imgheight/realheight*realwidth;//�ȱ������ſ��
if(imgwidth>windoww*scale) {//�����ӵ��ڴ��ڿ��
imgwidth = windoww*scale;//�ٶկ�ƚ�������
}
} else if(realwidth>windoww*scale) {//��ͼƭ�߶ⱥ��ʣ��ж�ͼƭ���
imgwidth = windoww*scale;//����ڴ��ڿ�ȣ�ͼƭ��ƚ�������
imgheight = imgwidth/realwidth*realheight;//�ȱ������ÿ߶�
} else {//���ͼƭ��ʵ�߶ⱥͿ�ȶ�����ҫ�߿����
imgwidth = realwidth;
imgheight = realheight;
}
$(bigimg).css("width",imgwidth);//�����յŀ�ȶ�ͼƭ����
var w = (windoww-imgwidth)/2;//����ͼƭ�봰����߾�
var h = (windowh-imgheight)/2;//����ͼƭ�봰���ϱ߾�
$(innerdiv).css({"top":h, "left":w});//����#innerdiv��top��left����
$(outerdiv).fadein("fast");//������ʾ#outerdiv��.pimg
});
$(outerdiv).click(function(){//�ٴε��������ʧ������
$(this).fadeout("fast");
});
}
showpre.prototype = {
move:function(test){ //滑动方法
var that = this;
var pos = this.c*this.w;
//document.title = (test&&that.timer);
if(test&&that.timer){
clearinterval(that.timer);
};
//当前序号图标
if(that.numico){
that.numicoli.removeclass("on");
var numc = that.c;
if(that.loop&&(that.c==(this.l-1))){
numc= 0;
};
that.numicoli.eq(numc).addclass("on");
};
this.box.stop();
this.box.animate({left:-pos},function(){
if(test&&that.auto){
that.autoplay();
};
if(that.loop&&that.c==that.maxl){
that.c = 0;
that.box.css({left:0})
};
});
if(that.bigbox)return false;
//设置大图加载序号
if(that.loadnumbox){
var loadc = parseint(that.c)+1;
loadc = loadc<10?"0"+loadc:loadc;
that.loadnumbox.html(loadc);
};
},
loadimg:function(test){ //加载大图方法
var that = this;
var _src = this.li.eq(that.loadnum).attr("bsrc"),bigth3=null,bigth4=null,bigtext=null;
if(that.li.eq(that.loadnum).attr("data-h")){
//$("#bigt h3").html(that.li.eq(that.loadnum).attr("data-h"));
var bigth3 = $("#bigt h3");
$("#bigt").hide();
bigth3.html("");
};
if(that.li.eq(that.loadnum).attr("data-m")){
//$("#bigt h4").html(that.li.eq(that.loadnum).attr("data-m"));
var bigth4 = $("#bigt h4");
$("#bigt").hide();
bigth4.html("");
};
if(that.li.eq(that.loadnum).attr("data-text")){
//$("#bigtext").html(that.li.eq(that.loadnum).attr("data-text"));
var bigtext = $("#bigtext");
bigtext.html("").hide();
};
var img = new image();
$(img).hide();
//loading dom操作(分首次加载和后面加载,根据点击操作设置运动方�?)
if(that.deinit){
var le = 0;
that.deinit = false;
that.bigbox.html("");
}else{
if(test!="pre"){
var le = -1230;
that.bigbox.append("");
}else{
var le = 1230;
that.bigbox.find(".loading").before("");
that.bigbox.css({"margin-left":-1230});
le = 0;
};
};
that.bigbox.animate({"margin-left":le},function(){
$(img).bind("load",function(){
//判断出现方向
if(test!="pre"){
var n = 1,oldn = 0;
}else{
var n = 0,oldn = 1;
};
that.bigbox.find(".loading").eq(n).html(img);
that.bigbox.find(".loading").eq(oldn).remove();
that.bigbox.css({"margin-left":0});
$(this).fadein(200,function(){
if(bigth3){
$("#bigt").fadein()
bigth3.html(that.li.eq(that.loadnum).attr("data-h"));
};
if(bigth4){
$("#bigt").fadein()
bigth4.html(that.li.eq(that.loadnum).attr("data-m"));
};
if(bigtext){
bigtext.html(that.li.eq(that.loadnum).attr("data-text")).fadein();
};
});
});
img.src = _src;
});
//添加当前加载序号
that.li.removeclass("on");
that.li.eq(that.loadnum).addclass("on");
if(that.loadnumbox){
var loadc = parseint(that.loadnum)+1;
loadc = loadc<10?"0"+loadc:loadc;
that.loadnumbox.html(loadc);
};
},
autoplay:function(){ //自动播放方法
var that =this;
that.timer = setinterval(function(){
that.c