PageSourceSearch

https://www.hamadasyuzou.co.jp/denbee/wp-content/themes/hamadasyuzou/common/js/text-overflow.js

js hamadasyuzou.co.jp collected 2026-10-02 08:11:47 UTC 874 bytes, 32 lines download raw bytes

1jQuery(function($) {
2  $('.text-overflow').each(function() {
3    var $target = $(this);
4 
5    // オリジナルの文章を取得する
6    var html = $target.html();
7 
8    // 対象の要素を、高さにautoを指定し非表示で複製する
9    var $clone = $target.clone();
10    $clone
11      .css({
12        display: 'none',
13        position : 'absolute',
14        overflow : 'visible'
15      })
16      .width($target.width())
17      .height('auto');
18 
19    // DOMを一旦追加
20    $target.after($clone);
21 
22    // 指定した高さになるまで、1文字ずつ消去していく
23    while((html.length > 0) && ($clone.height() > $target.height())) {
24      html = html.substr(0, html.length - 1);
25      $clone.html(html + '...');
26    }
27 
28    // 文章を入れ替えて、複製した要素を削除する
29    $target.html($clone.html());
30    $clone.remove();
31  });
32});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.