|
@@ -295,35 +295,121 @@
|
|
|
$("#HomeTemplate").tmpl(result.data.e.introduce_model).appendTo("#HomeContent");
|
|
|
$("#NewsTemplate").tmpl(result.data.c.introduce_model).appendTo("#NewsContent");
|
|
|
$("#ExpeTemplate").tmpl(result.data.d.introduce_model).appendTo("#ExpeContent");
|
|
|
- var winResize = function() {
|
|
|
- var width = $(window).width();
|
|
|
- var height = $(window).height();
|
|
|
- $('.full-height').height(height);
|
|
|
-
|
|
|
- if(width <= 767) {
|
|
|
- $('body').addClass('small-screen');
|
|
|
- $('body').removeClass('normal-screen');
|
|
|
- } else {
|
|
|
- $('body').removeClass('small-screen');
|
|
|
- $('body').addClass('normal-screen');
|
|
|
- }
|
|
|
+ $(function() {
|
|
|
+ $(window).resize(function() {
|
|
|
+ winResize();
|
|
|
+ });
|
|
|
+ winResize();
|
|
|
+ setTimeout(function() {
|
|
|
+ winResize();
|
|
|
+ }, 100);
|
|
|
+
|
|
|
+ $(window).scroll(function() {
|
|
|
+ var sTop = $(window).scrollTop();
|
|
|
+ var wHeight = $(window).height();
|
|
|
+ var sBottom = wHeight - ($('body').height() - sTop);
|
|
|
+
|
|
|
+ });
|
|
|
+ $('header .mbtn').click(function(event) {
|
|
|
+ $('body').toggleClass('on-menu');
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+ $('header .menu >a').click(function(event) {
|
|
|
+ $('body').removeClass('on-menu');
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+ $('.carousel').swipe({
|
|
|
+ threshold: 25,
|
|
|
+ allowPageScroll: 'vertical',
|
|
|
+ swipe: function(event, direction, distance, duration, fingerCount, fingerData) {
|
|
|
+ console.log(direction);
|
|
|
+ if(direction == 'left') {
|
|
|
+ $(this).carousel('next');
|
|
|
+ } else {
|
|
|
+ $(this).carousel('prev');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if(browser == 'ie6' || browser == 'ie7' || browser == 'ie8' || browser == 'ie9') {
|
|
|
|
|
|
- if($('body').hasClass('normal-screen')) {
|
|
|
- $('.bg-contactus').height(height - $('footer').outerHeight());
|
|
|
} else {
|
|
|
- $('main').css('min-height', $(window).height() - $('footer').outerHeight(true));
|
|
|
+ new WOW({
|
|
|
+ callback: function(box) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }).init();
|
|
|
}
|
|
|
|
|
|
+ $('#carousel-homebanner').on('slid.bs.carousel', function() {
|
|
|
+ var ind = $('#carousel-homebanner .item').index($('#carousel-homebanner .item.active'));
|
|
|
+ $('.ui-homebanner .navi a').removeClass('on');
|
|
|
+ $('.ui-homebanner .navi a').eq(ind).addClass('on');
|
|
|
+ });
|
|
|
+ $('.ui-homebanner .navi a').click(function(event) {
|
|
|
+ var ind = $('.ui-homebanner .navi a').index($(this));
|
|
|
+ $('#carousel-homebanner').carousel(ind);
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+
|
|
|
$('.lrlist').each(function(index, el) {
|
|
|
var $this = $(this);
|
|
|
- var count = $this.data('count-pc');
|
|
|
- if($('body').hasClass('small-screen')) {
|
|
|
- count = $this.data('count-mb');
|
|
|
+ var $aw = $this.find('.aw');
|
|
|
+
|
|
|
+ $aw.click(function(event) {
|
|
|
+ if($this.find('ul').is(':animated')) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var next = true;
|
|
|
+ if($(this).hasClass('l')) {
|
|
|
+ next = false;
|
|
|
+ }
|
|
|
+ var $next;
|
|
|
+ var w = $this.find('li').width();
|
|
|
+ if(next) {
|
|
|
+ $next = $this.find('li').first().clone();
|
|
|
+ $next.appendTo($this.find('ul'));
|
|
|
+ $this.find('ul').animate({
|
|
|
+ 'left': -1 * w
|
|
|
+ }, 300, function() {
|
|
|
+ $this.find('li').first().remove();
|
|
|
+ $this.find('ul').css('left', 0);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ $next = $this.find('li').last().clone();
|
|
|
+ $next.prependTo($this.find('ul'));
|
|
|
+ $this.find('ul').css('left', -1 * w);
|
|
|
+ $this.find('ul').animate({
|
|
|
+ 'left': 0
|
|
|
+ }, 300, function() {
|
|
|
+ $this.find('li').last().remove();
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ clearInterval(t);
|
|
|
+ t = setInterval(function() {
|
|
|
+ go();
|
|
|
+ }, 5000);
|
|
|
+
|
|
|
+ $('.ui-prodhead .view >.ct .i').hover(function() {
|
|
|
+ $(this).click();
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+
|
|
|
+ var go = function() {
|
|
|
+ if($this.hasClass('noauto')) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $aw.filter('.r').click();;
|
|
|
}
|
|
|
- $this.find('ul li').width(Math.floor($this.width() / count));
|
|
|
- $this.find('ul').width($this.find('ul li').width() * ($this.find('ul li').length + 1));
|
|
|
+ var t = setInterval(function() {
|
|
|
+ go();
|
|
|
+ }, 5000);
|
|
|
});
|
|
|
- }
|
|
|
+
|
|
|
+ });
|
|
|
|
|
|
}, "json");
|
|
|
}
|