DailyJS

jQuery Roundup: trunk8, tcsst, MaxImage

Alex R. Young

Subscribe

@dailyjs

Facebook

Google+

jquery testing plugins galleries truncation

jQuery Roundup: trunk8, tcsst, MaxImage

Posted by Alex R. Young on .
Featured

jquery testing plugins galleries truncation

jQuery Roundup: trunk8, tcsst, MaxImage

Posted by Alex R. Young on .
Note: You can send your plugins and articles in for review through our contact form or @dailyjs.

trunk8

trunk8 (GitHub: rviscomi / trunk8) by Rick Viscomi is a text truncation plugin. Truncating text in browsers is actually quite awkward to do well, and I haven't yet found a plugin that does it particularly well when a certain number of vertical lines is required. However, this one appears to do that through the lines option, and it also does a lot more: tooltips can be created, character count is supported, and the internal calculations are cached so it should perform very well.

The author has attempted to address performance using several familiar client-side hacks, so if speed is an issue this might be a good choice. The author hasn't included unit tests or benchmarks, so it might take a bit of jsPerf to really see how efficient it is.

tcsst

tcsst by Paul Battley is a CSS testing script for jQuery. The author wrote it because "life's too short to click around". It's basically a simple test runner with a CSS-specific flavour: tests are defined in terms of CSS selectors:

tcsst(function(tc){  
  tc.test('top of paragraph should be at a multiple of line-height', 'p',
    function(test, element){
      var lineHeight = parseInt($('body').css('line-height'), 10);
      var diff = $(element).offset().top % lineHeight;
      test.assert((0 == diff), 'Off by ' + diff + 'px');
    });
});

It's an interesting concept, and I think there's a lot of room for time-saving assertions that are tailored for CSS.

MaxImage 2.0

MaxImage 2.0 (GitHub: akv2 / MaxImage, License: MIT/GPL) by Aaron Vanderzwan is a fullscreen background slideshow plugin. There's a demo of MaxImage that shows it being used with the jQuery Cycle and Easing plugins.

This plugin actually checks if the browser supports background-size, so it should look good in modern browsers. It also pre-loads images.