fengjuan vor 4 Jahren
Ursprung
Commit
cf7fd5ff92
2 geänderte Dateien mit 173 neuen und 1 gelöschten Zeilen
  1. 30 1
      index.html
  2. 143 0
      skin/js/script.js

+ 30 - 1
index.html

@@ -239,7 +239,7 @@
 		<script type="text/html" id="FootlistTemplate">
 			<a href="{{= url}}?id={{= id }}">{{= name }}</a> <i>|</i>
 		</script>
-		<script src="/skin/js/script.js"></script>
+		<!--<script src="/skin/js/script.js"></script>-->
 		<script src="/skin/js/jquery.tmpl.js"></script>
 		<script type="text/javascript">
 			//页面转载完毕后启动
@@ -295,6 +295,35 @@
 					$("#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');
+						}
+
+						if($('body').hasClass('normal-screen')) {
+							$('.bg-contactus').height(height - $('footer').outerHeight());
+						} else {
+							$('main').css('min-height', $(window).height() - $('footer').outerHeight(true));
+						}
+
+						$('.lrlist').each(function(index, el) {
+							var $this = $(this);
+							var count = $this.data('count-pc');
+							if($('body').hasClass('small-screen')) {
+								count = $this.data('count-mb');
+							}
+							$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));
+						});
+					}
 					$(function() {
 						$(window).resize(function() {
 							winResize();

+ 143 - 0
skin/js/script.js

@@ -8019,4 +8019,147 @@ if(browser == "Microsoft Internet Explorer" && trim_Version == "MSIE6.0") {
 	browser = 'ie9';
 }
 
+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');
+	}
+
+	if($('body').hasClass('normal-screen')) {
+		$('.bg-contactus').height(height - $('footer').outerHeight());
+	} else {
+		$('main').css('min-height', $(window).height() - $('footer').outerHeight(true));
+	}
+
+	$('.lrlist').each(function(index, el) {
+		var $this = $(this);
+		var count = $this.data('count-pc');
+		if($('body').hasClass('small-screen')) {
+			count = $this.data('count-mb');
+		}
+		$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));
+	});
+}
+$(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') {
+
+	} else {
+		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 $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();;
+		}
+		var t = setInterval(function() {
+			go();
+		}, 5000);
+	});
 
+});