Skip to content

Commit

Permalink
As suggested by @cindreta added width and height attributes to th…
Browse files Browse the repository at this point in the history
…e preload placeholder `<img>`s to possibly facilitate the speed benefit of loading images with pre-defined dimensions. Using stage dimensions. #10
  • Loading branch information
pisi committed Nov 9, 2011
1 parent d0c4af1 commit c77e860
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/unit/rendering.js
Expand Up @@ -196,4 +196,20 @@
});
});

asyncTest( 'Preload cache `img`s have defined stage dimensions #10', function(){
expect(3);
var
$reel= $('#image').reel()

$reel.bind('loaded', function(){
var
$cached= $reel.siblings('img[width][height]')

equal($cached.length, 1, 'Image has dimensions');
equal($cached.attr('width'), $reel.data('dimensions').x, 'Width equals')
equal($cached.attr('height'), $reel.data('dimensions').y, 'Height equals')
start();
});
});

})(jQuery);

0 comments on commit c77e860

Please sign in to comment.