Skip to content

Instantly share code, notes, and snippets.

⚡️
发电

DIYgod DIYgod

⚡️
发电
Block or report user

Report or block DIYgod

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:98d33aba4c035d85b5b6dc4449f2f080
const initEllipsis = (ele, height) => {
ele.each(function () {
var $this = $(this);
var text = $this.text();
var lastLength = text.length;
var destination = height;
$this.height('auto');
while ($this.height() > destination && lastLength > 0) {
View gist:53967895af30f1f720b2
// dotdotdot
function initEllipsis(ele, height) {
ele.each(function () {
var $this = $(this);
var text = $this.text();
var lastLength = text.length;
var destination = height;
$this.height('auto');
You can’t perform that action at this time.