banner 背景色 @review by 王成龙
Showing
3 changed files
with
13 additions
and
4 deletions
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <div class="slide-wrapper"> | 2 | <div class="slide-wrapper"> |
3 | <ul> | 3 | <ul> |
4 | {{# list}} | 4 | {{# list}} |
5 | - <li style="backgroundColor:{{bgColor}}"> | 5 | + <li style="background:{{bgColor}}"> |
6 | <a href="{{href}}" target= "_blank"> | 6 | <a href="{{href}}" target= "_blank"> |
7 | <img class="lazy" data-original="{{img}}" alt=""> | 7 | <img class="lazy" data-original="{{img}}" alt=""> |
8 | </a> | 8 | </a> |
@@ -21,6 +21,10 @@ var $ = require('yoho.jquery'), | @@ -21,6 +21,10 @@ var $ = require('yoho.jquery'), | ||
21 | 21 | ||
22 | Slider.prototype = { | 22 | Slider.prototype = { |
23 | init: function() { | 23 | init: function() { |
24 | + if (!this.$element) { | ||
25 | + return; | ||
26 | + } | ||
27 | + | ||
24 | if (this.len <= 1) { | 28 | if (this.len <= 1) { |
25 | lazyLoad(this.$element.find('img.lazy')); | 29 | lazyLoad(this.$element.find('img.lazy')); |
26 | return; | 30 | return; |
@@ -126,7 +130,13 @@ var $ = require('yoho.jquery'), | @@ -126,7 +130,13 @@ var $ = require('yoho.jquery'), | ||
126 | 130 | ||
127 | 131 | ||
128 | this.smallItem.eq(this.index).addClass('focus').siblings().removeClass('focus'); | 132 | this.smallItem.eq(this.index).addClass('focus').siblings().removeClass('focus'); |
129 | - this.bigItem.eq(this.index).fadeIn().siblings().fadeOut(); | 133 | + this.bigItem.eq(this.index).show().stop().animate({ |
134 | + opacity: 1 | ||
135 | + }).siblings().stop().animate({ | ||
136 | + opacity: 0 | ||
137 | + }, function() { | ||
138 | + $(this).hide(); | ||
139 | + }); | ||
130 | }, | 140 | }, |
131 | _autoplay: function() { | 141 | _autoplay: function() { |
132 | var that = this; | 142 | var that = this; |
@@ -41,9 +41,8 @@ if (homePage === 'boys') { | @@ -41,9 +41,8 @@ if (homePage === 'boys') { | ||
41 | $('.slide-container').slider({ | 41 | $('.slide-container').slider({ |
42 | pagination: '.thumb-pagination' | 42 | pagination: '.thumb-pagination' |
43 | }); | 43 | }); |
44 | -} else if (homePage === 'girls') { | ||
45 | - $('.center-col').slider(); | ||
46 | } else { | 44 | } else { |
45 | + $('.center-col').slider(); | ||
47 | $('.slide-container').slider(); | 46 | $('.slide-container').slider(); |
48 | } | 47 | } |
49 | 48 |
-
Please register or login to post a comment