adaptive-height.js 690 B

1234567891011121314151617181920212223242526272829
  1. QUnit.test( 'adaptiveHeight', function( assert ) {
  2. 'use strict';
  3. var flkty = new Flickity( '#adaptive-height', {
  4. adaptiveHeight: true
  5. });
  6. // 2,1,3, 1,4,2, 1,2,1
  7. function checkSelectHeight( index, height ) {
  8. flkty.select( index, false, true );
  9. assert.equal( flkty.viewport.style.height, height + 'px', 'slide ' + index );
  10. }
  11. checkSelectHeight( 0, 200 );
  12. checkSelectHeight( 1, 100 );
  13. checkSelectHeight( 2, 300 );
  14. checkSelectHeight( 3, 100 );
  15. checkSelectHeight( 4, 400 );
  16. checkSelectHeight( 5, 200 );
  17. flkty.options.groupCells = true;
  18. flkty.resize();
  19. checkSelectHeight( 0, 300 );
  20. checkSelectHeight( 1, 400 );
  21. checkSelectHeight( 2, 200 );
  22. });