Coder Social home page Coder Social logo

jsillitoe / jquery-condense-plugin Goto Github PK

View Code? Open in Web Editor NEW
36.0 36.0 20.0 26 KB

jQuery plugin to condense and truncate blocks of text into smaller blocks and provide smooth animation for expanding.

License: GNU General Public License v2.0

HTML 40.18% JavaScript 59.82%

jquery-condense-plugin's People

Contributors

apassant avatar davisre avatar jsillitoe avatar mfollett avatar svrx 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jquery-condense-plugin's Issues

inline ellipsis location?

Hi, can anybody help me to figure out how to move the ellipsis (...) to output inline next to the truncated text? I need to have the 'more' link on its own line which I have done using css but i can't see how to move the '...' to append inline at the end of the truncated text?

Here is an example of how I would like my finished text block to look (notice the different placement of the '...' :
Example text lorem ipsum dolor ...
Read More

but all I can get is:
Example text lorem ipsum dolor
... Read More

Looking at the plugin code, I can't see where in the code I can change where the ellipsis is output?
Many Thanks for any help..

Metadata plugin is old school

Nice plugin although no need for the meta data plugin with the HTML5 data attributes.

E.g:

var o = $this.data('plugin-options') ? $.extend({}, opts, $this.data('plugin-options')) : opts;
<div class=condense' data-plugin-options='{"condensedLength":"50"}'></div>

IE problem with condensedLength

condensedLength property appears to make IE8 go completely unresponsive. Any value, any setting, as long as this property is being used in the code, IE goes unresponsive. This has been verified in your demo file and my own implementation.

Infinte loop when condensed length cutoff occurs in consecutive spaces

For example:

Assume that fullbody == "1234      123456789012345678901", opts.condensedLength == 6, and delta == 1.
In that case, loc will be 7, and $.trim(fullbody.substring(0,(loc+1))) will return "1234".
Since "1234".length == 4 which is less than opts.condensedLength, the do-while loop between lines 87 and 97 will be infinite.

This, of course, crashes browsers.

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.