Two lines of text (ellipsis on 2nd line if text overflows)

First we create es5 class for SentenceManipulator. This is so that it can get the first two sentence of a long paragraph. Once, we get the two sentences, we place them into 2 divs. Then display the divs. var DASHBOARD_CONST ={ NUM_OF_LINES:2 };

SentenceManipulator implementation

quotes on love and relationship

每一个好的爱情,基于在尊重上。如果没有尊重,这个爱活不下去的。 每天要跟新你的爱。讲个笑话。。。带她出去玩。。。给他推拿。。。 结婚的目的,是教你怎么去做多情的朋友们。 爱情不会要求占有。爱情是给自由的。 你爱一个人,因为只有你能听到他生活上唱的歌。 微笑开始一个爱情。亲吻把爱情增长。拥抱让爱情持久。 爱是什么? 当两端有足够的空间时,爱就会让两个人坐在长凳的中间。

Wait for end of resize event (jQuery)

ref –

num of lines v2

todo – given a that a previous space exists: usually when we pass the limit with a letter, we shift down to the next line, and keep going with the word after the ‘previous space’. “abcde fghijk”(‘l’ passed limit) becomes “abcde fghijklmn” However, there is a case where if the offending letter that went passed […]

try it: using height

font-family: ‘FSElliotPro’ font-size: 14px

Number of Lines

github source What does it do Calculate how many lines are there when you put a long string into a div/span that has a width. Getting Started First, let’s set it up. We create a div with id para. We limit it to 68px so we can see the effects of the word break. html […]

double line with ellipsis

Chaining Promises

tooltip using css and html



Mustache templating for displaying data (JS)

ref – Templates are a great way to separate your website’s code from its design. Mustache is a logic-less template syntax. It can be used for HTML, config files, source code – anything. It works by expanding tags in a template using values provided in a hash or object One of Mustache’s […]