Authored by ccbikai

CSS 文字截断

... ... @@ -7,7 +7,6 @@
var $ = require('yoho-jquery'),
Swiper = require('yoho-swiper'),
tip = require('../plugin/tip'),
lazyLoad = require('yoho-jquery-lazyload'),
loading = require('../plugin/loading'),
PullRefresh = require('../plugin/pull-refresh');
... ... @@ -41,13 +40,14 @@ if ($window.width() === 375 && isiOS) {
}
require('../common');
require('yoho-jquery-lazyload');
$window.on('mousewheel', false);
// 限制标题字数
function txtLimit() {
}
// function txtLimit() {
//
// }
// 设置默认头像
function setAvatar($userAvatar) {
... ... @@ -140,13 +140,13 @@ function setIndexAction() {
});
}
if ($('.star-info').find('li').length > 0) {
$starArticle.each(function(key, item) {
txtLimit($(item), '.article-title', 'p');
// articleImgAction($(item), key);
});
}
// if ($('.star-info').find('li').length > 0) {
// $starArticle.each(function(key, item) {
// txtLimit($(item), '.article-title', 'p');
//
// // articleImgAction($(item), key);
// });
// }
$('.rank-avatar').each(function(key, item) {
setAvatar($(item));
... ... @@ -170,11 +170,6 @@ function initAction() {
$avatarClone = $('.avatar-clone');
// 限制标题字数
$('.cont-area').each(function() {
txtLimit($(this), '.title', '.cont-txt');
});
$('img.lazy').lazyload({
effect: 'fadeIn'
});
... ...
... ... @@ -240,8 +240,14 @@
.article-title {
font-size: 28px;
line-height: 38px;
height: 76px;
color: #fff;
word-wrap: break-word;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
display: flex;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.artice-cont {
... ... @@ -256,6 +262,7 @@
}
.artice-imgs-area {
position: relative;
display: table;
margin: 10px 0;
width: 266px;
... ... @@ -263,9 +270,11 @@
overflow: hidden;
img {
position: absolute;
width: 100%;
display: table-cell;
vertical-align: middle;
left: 0;
top: 50%;
transform: translateY(-50%);
}
}
... ...