// animate 鍔ㄧ敾鏍峰紡
var $easing = ['linear', 'swing', 'easeInQuad', 'easeOutQuad', 'easeInOutQuad', 'easeInCubic', 'easeOutCubic', 'easeInOutCubic', 'easeInQuart', 'easeOutQuart', 'easeInOutQuart', 'easeInQuint', 'easeOutQuint', 'easeInOutQuint', 'easeInExpo', 'easeOutExpo', 'easeInOutExpo', 'easeInSine', 'easeOutSine', 'easeInOutSine', 'easeInCirc', 'easeOutCirc', 'easeInOutCirc', 'easeInElastic', 'easeOutElastic', 'easeInOutElastic', 'easeInBack', 'easeOutBack', 'easeInOutBack', 'easeInBounce', 'easeOutBounce', 'easeInOutBounce']
$('.ddw').val(0);
$('.ddw2').val(0);
for (var j = 0; j <= $('.index').size() - 1; j++) {
var li = '
' + $('.index').eq(j).attr('_title') + '
';
$('.fixed_r ul').append(li);
}
$('.fixed_r').css({
height: $(window).height() - $('.head_box').outerHeight(true) - $('.foot_box').outerHeight(true),
top: $('.head_box').outerHeight(true)
});
// 涓嬫媺
var nav_li=$('.nav li');
nav_li.hover(
function(){
$(this).find('.second_level').stop().slideDown(200)
},
function(){
$(this).find('.second_level').stop().slideUp(200)
}
)
function goPlay(a, b) {
// 绗 2 灞 鍔ㄧ敾
if(a == b){_number(); }
if (a == b * 2) {$('.ico_text').show(); }else{$('.ico_text').hide();}
}
$(function() {
$('.index_box').mousewheel(function(event, delta) {
var aaaa = $('.ddw2').val();
if (aaaa == 1) {
return;
}
qpgd(delta);
});
});
$('.rutent_top').click(function() {
$('.ddw').val(0);
$('.index_box').css({
'transform': 'translate(0px, 0px)'
});
$('.fixed_r ul li').eq(0).addClass('active').siblings('li').removeClass('active');
});
function qpgd(a) {
var z = $('.ddw').val();
b = parseInt(z);
c = $('.index').length;
if (a < 0) {
if (-b == c - 1) {
return;
}
b -= 1;
$('.ddw2').val(1);
} else if (a > 0) {
if (-b == 0) {
return;
}
b += 1;
$('.ddw2').val(1);
}
$('.ddw').val(b);
$('.fixed_r ul li').eq(-b).addClass('active').siblings('li').removeClass('active');
var single_hh = $(window).height();
click_hh = -single_hh * b;
goPlay(click_hh, single_hh);
$('.index_box').css({
'transform': 'translate(0,-' + click_hh + 'px)'
});
setTimeout(function() {
$('.ddw2').val(0);
},800);
}
$('.fixed_r ul li').first().addClass('active');
function quanp() {
var single_hh = $(window).height();
var single_ww = $(window).width();
$('.index').height(single_hh);
// $('.index li').width(single_ww);
}
quanp();
$(window).resize(function() {
if (typeof indexSlides != 'undefined' && indexSlides.reformat)
indexSlides.reformat();
quanp();
});
// 绗簩鎺 婊氬姩鏁板瓧閫掑
function _number(){
$.fn.countTo = function(a) {
a = a || {};
return $(this).each(function() {
var c = $.extend({},
$.fn.countTo.defaults, {
from: $(this).data("from"),
to: $(this).data("to"),
speed: $(this).data("speed"),
refreshInterval: $(this).data("refresh-interval"),
decimals: $(this).data("decimals")
},
a);
var h = Math.ceil(c.speed / c.refreshInterval),
i = (c.to - c.from) / h;
var j = this,
f = $(this),
e = 0,
g = c.from,
d = f.data("countTo") || {};
f.data("countTo", d);
if (d.interval) {
clearInterval(d.interval)
}
d.interval = setInterval(k, c.refreshInterval);
b(g);
function k() {
g += i;
e++;
b(g);
if (typeof(c.onUpdate) == "function") {
c.onUpdate.call(j, g)
}
if (e >= h) {
f.removeData("countTo");
clearInterval(d.interval);
g = c.to;
if (typeof(c.onComplete) == "function") {
c.onComplete.call(j, g)
}
}
}
function b(m) {
var l = c.formatter.call(j, m, c);
f.html(l)
}
})
};
$.fn.countTo.defaults = {
from: 0,
to: 0,
speed: 1000,
refreshInterval: 100,
decimals: 0,
formatter: formatter,
onUpdate: null,
onComplete: null
};
function formatter(b, a) {
return b.toFixed(0)
}
$(".number").children().data("countToOptions", {
formatter: function(b, a) {
return b.toFixed(0).replace(/\B(?=(?:\d{3})+(?!\d))/g, "")
}
});
$(".number").children().each(count);
function count(a) {
var b = $(this);
a = $.extend({},
a || {},
b.data("countToOptions") || {});
b.countTo(a);
};
}