Skip to content

Height does not adjust for responsive content within tab #142

@elmonty

Description

@elmonty

The autoHeight animation sets the .tab-content element to a fixed height. This causes content to be cut off when the browser is resized to be narrower.

The .tab-content element should have its height set to "auto" in order to accommodate the height of the content changing as the browser is resized. Before starting the tab switching animation, the height of .tab-content can be changed to a fixed size for the duration of the animation, then changed back to "auto" when the animation is done.

  1. At the top of each transition, set the container to a fixed height:

this.container.height(this.container.height());

  1. Change _fixHeight to set the container height to auto:
      function _fixHeight(idx) {
        // Auto adjust height of the container
        if (this.options.autoAdjustHeight) {
			var container = this.container;
            var selPage = this._getStepPage(idx);

            container.finish().animate({
              height: selPage.outerHeight()
            }, this.options.transition.speed, undefined, function(){
			  container.height('auto');
		  });
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions