Authored by zhangxiaoru

首页滚动修改

@@ -3,7 +3,8 @@ @@ -3,7 +3,8 @@
3 let $ = require('yoho-jquery'); 3 let $ = require('yoho-jquery');
4 4
5 let $news = $('.news'), 5 let $news = $('.news'),
6 - newsLiL = $news.find('li').length; 6 + newsLiL = $news.find('li').length,
  7 + newsHeight = 0;
7 8
8 // tip = require('plugin/tip'); 9 // tip = require('plugin/tip');
9 10
@@ -14,8 +15,7 @@ if ($('.share-buy-page').height() < $(window).height()) { @@ -14,8 +15,7 @@ if ($('.share-buy-page').height() < $(window).height()) {
14 } 15 }
15 16
16 function Marquee() { 17 function Marquee() {
17 - let diff,  
18 - newsHeight = $news.find('li:first').height() * newsLiL; 18 + let diff;
19 19
20 $news.scrollTop($news.scrollTop() + 1); 20 $news.scrollTop($news.scrollTop() + 1);
21 21
@@ -30,5 +30,11 @@ if (newsLiL > 1) { @@ -30,5 +30,11 @@ if (newsLiL > 1) {
30 30
31 $news.append('<li>' + $news.find('li:first').html() + '</li>'); 31 $news.append('<li>' + $news.find('li:first').html() + '</li>');
32 32
  33 + for (let i = 0; i < newsLiL; i++) {
  34 + $news.find('li').eq(i).height($news.find('li:first').height());
  35 +
  36 + newsHeight = newsHeight + $news.find('li').eq(i).height();
  37 + }
  38 +
33 setInterval(Marquee, 100); 39 setInterval(Marquee, 100);
34 } 40 }
@@ -105,7 +105,7 @@ @@ -105,7 +105,7 @@
105 105
106 .news { 106 .news {
107 background-color: #222; 107 background-color: #222;
108 - height: 100%; 108 + height: inherit;
109 overflow: hidden; 109 overflow: hidden;
110 110
111 li { 111 li {