Giter VIP home page Giter VIP logo

clamp-js-main's People

Contributors

anzhelikakovalchuk avatar el-teedee avatar jmenglis avatar josephschmitt avatar nedbaldessin avatar xavi160 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

clamp-js-main's Issues

In Firefox/IE if clamp is set to 2, it still shows an ellipsis on the 2nd line, even if the line was not clamped.

In Chrome, the text looks correct... i.e no ellipsis on the 2nd line of text, as the text is not wrapping to a 3rd line...
http://pasteboard.co/ArBHmdnam.jpg

But in IE/Firefox, even though the 2nd line is nowhere near wrapping, it still shows an ellipsis.
http://pasteboard.co/3DXHJQgQp.jpg

I am using

$('.clamp').each(function (i, obj) { $clamp(obj, { clamp: 2, useNativeClamp: false, truncationChar: '...' }); });

Note : I had to set useNativeClamp to false to prevent another issue in Safari, which added a ... in the middle of the sentence.

Clamping in IE

I'm having an issue with clamping in IE to 2 lines only.
Have the same function with 3 line, and it works perfectly, and it clamps the full component to ellipsis if $clamp(element, { clamp: 2});

Would appreciate any suggestions

how to change truncation style ?

I want to change the code below(line between 255-259)

sty.overflow = 'hidden';
sty.textOverflow = 'ellipsis';
sty.webkitBoxOrient = 'vertical';
sty.display = '-webkit-box';
sty.webkitLineClamp = clampValue;

to this

element.stylesheet.insertRule(
 '.content::after{' +
 'content: "..."; position: absolute; bottom: 0; right: 0; padding-left: 40px;' +
 'background: -webkit-linear-gradient(left, transparent, #fff 55%);' +
 "background: -o-linear-gradient(right, transparent, #fff 55%);" +
 'background: -moz-linear-gradient(right, transparent, #fff 55%);' +
 '+background: linear-gradient(to right, transparent, #fff 55%);}'
 ,0);

but, it't don't work, and the class '.content::after' don't add to the element,

so, is there a method that I can add custom truncation style more easier?

Thanks a lot for your help!

Truncation Characters not working

Changing Truncation Characters does not current work in clamp-js.

$clamp(paragraph, {
      clamp: 10,
      useNativeClamp: false,
      animate: true
      truncationChar: '!!!'
});

Version: 0.11.4

Does not work with inline elements

Hey mate, it does work but not with display: inline elements. And I can't remove the display: inline what should I do?
.article-card .card-title { padding: 0rem 0.3rem; line-height: 1.56; display: inline; box-decoration-break: clone; -webkit-box-decoration-break: clone; border-radius: 2px; transition: background 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955), color 0.3s cubic-bezier(0.455, 0.03, 0.515, 0.955); }
capture

Not working In Firefox

I open the example in chrome (Version 58.0.3029.81) and doesn't show the "<h1>" text.
I tested in my own code and set 'clamp: 3' and some items show 3 lines and other shows 4 (this is in firefox)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.