Authored by 郝肖肖

资讯收藏样式调整

... ... @@ -126,10 +126,10 @@
<span class="like-num">{{likeNum}}</span>
</a>
</li>
<li id="collect-btn" class="sort-collect{{# isCollected}} collected{{/ isCollected}}">
<li id="collect-btn" class="collect-btn sort-collect{{# isCollected}} collected{{/ isCollected}}">
<a href="javascript:;">
<i class="iconfont">&#xe6b5;</i>
<span>收藏</span>
<span>{{# isCollected}}{{/ isCollected}}收藏</span>
</a>
</li>
</ul>
... ...
... ... @@ -26,6 +26,7 @@ var $commentList = $commentArea.find('.comments-wrap'),
next = $('.chapter-right').find('a');
require('../plugins/share');
require('../common/return-top');
require('../common/header');
lazyLoad($('img'));
... ... @@ -72,16 +73,19 @@ $('#prise-btn').click(function() {
$('#collect-btn').click(function() {
var collecting = false,
url,
isfav = false,
$this = $(this);
if (collecting) {
return;
}
if ($this.hasClass('collected')) {
isfav = false;
// 取消收藏
url = '/editorial/info/cancelcollect';
} else {
isfav = true;
// 收藏
url = '/editorial/info/collect';
... ... @@ -95,6 +99,7 @@ $('#collect-btn').click(function() {
}
}).then(function(data) {
if (data.code === 200) {
$this.find('span').html((isfav ? '已' : '') + '收藏');
new _alert(data.message).show();
$this.toggleClass('collected');
} else if (data.code === 400) {
... ... @@ -104,8 +109,18 @@ $('#collect-btn').click(function() {
}
collecting = false;
});
}).bind('mouseenter mouseleave', function() {
$(this).toggleClass('hover');
}).hover(function() {
var $this = $(this);
if ($this.hasClass('collected')) {
$this.find('span').html('取消收藏');
}
}, function() {
var $this = $(this);
if ($this.hasClass('collected')) {
$this.find('span').html('已收藏');
}
});
function showComment() {
... ...
... ... @@ -22,8 +22,8 @@
position: absolute;
margin-top: 9px;
text-align: center;
top: 15px;
left: 10px;
top: 10px;
left: 23px;
z-index: 2;
h2 {
... ...
... ... @@ -284,6 +284,8 @@
float: left;
margin: 0 15px;
cursor: pointer;
color: #999 !important;
font-size: 14px;
a {
position: relative;
... ... @@ -291,15 +293,13 @@
padding: 0 10px;
height: 36px;
line-height: 36px;
color: #535353;
font-size: 0;
text-align: left;
color: inherit;
}
span {
display: inline-block;
font-style: normal;
font-size: 14px;
}
i {
... ... @@ -307,7 +307,11 @@
font-style: normal;
margin: 0 5px 0 0;
font-size: 18px;
opacity: 0.5;
}
&.liked,
&.collected {
color: #1b1b1b !important;
}
}
... ... @@ -315,15 +319,6 @@
display: none;
}
.like-status.liked i,
.like-status.hover i {
opacity: 0.5;
}
.like-statis.hover .like-num {
color: #000;
}
.sort-collect a {
i {
width: 21px;
... ... @@ -331,24 +326,6 @@
top: 2px;
}
}
.sort-collect.collected a {
i {
opacity: 1;
}
.cancel-collect {
display: inline;
}
}
.sort-collect.hover i {
opacity: 1;
}
.sort-collect.hover span {
color: #000;
}
}
}
... ...
... ... @@ -5,13 +5,13 @@
.msg-left {
position: relative;
float: left;
width: 180px;
height: 30px;
margin-right: 90px;
line-height: 30px;
text-align: center;
border-bottom: 1px solid #bbb;
color: #999;
padding: 0 10px;
}
.msg-right {
... ...