Commit 6cb5dd2e by o.kimura

ニュース一覧・お知らせ一覧 110文字超過したら末尾を「...」に

parent c8280891
......@@ -122,6 +122,7 @@
<?php if($pageid == "news" || $pageid == "news-info" || $pageid == "news-20200310" || $pageid == "news-20200302" || $pageid == "news-20200227" || $pageid == "news-20200226" || $pageid == "news-20200221" || $pageid == "news-20200217") { ?>
<link rel="stylesheet" href="/common_previous/css/trainer.css">
<link rel="stylesheet" href="/common_previous/css/indivisual-base.css">
<link rel="stylesheet" href="/common_previous/css/news.css">
<?php } ?>
<?php if($pageid == "company-access") { ?>
......
@charset "UTF-8";
/* ========================================
news.css
======================================== */
.list_text {
visibility: hidden;
}
$(function () {
var $setElm = $('.list_text');
var cutFigure = '110'; // カットする文字数
var afterTxt = '...'; // 文字カット後に表示するテキスト
$setElm.each(function () {
var textLength = $(this).text().length;
var textTrim = $(this).text().substr(0, (cutFigure))
if (cutFigure < textLength) {
$(this).html(textTrim + afterTxt).css({
visibility: 'visible'
});
} else if (cutFigure >= textLength) {
$(this).css({
visibility: 'visible'
});
}
});
});
$(function(){var t=$(".list_text"),a="110",s="...";t.each(function(){var t=$(this).text().length,e=$(this).text().substr(0,a);t>a?$(this).html(e+s).css({visibility:"visible"}):a>=t&&$(this).css({visibility:"visible"})})});
\ No newline at end of file
......@@ -178,4 +178,5 @@
</main>
</div>
</div>
<script src="/common_previous/js/news.min.js"></script>
<?php include($_SERVER['DOCUMENT_ROOT'] . '/assets/include/footer.php'); ?>
......@@ -198,4 +198,5 @@
</main>
</div>
</div>
<script src="/common_previous/js/news.min.js"></script>
<?php include($_SERVER['DOCUMENT_ROOT'] . '/assets/include/footer.php'); ?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment