Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (26 sloc) 0.724 kB

JqueryIframeAutoResize

JQuery Plugin to auto-resize iFrames from same domain.

Setup: put following to your Gemfile

..
gem "jquery-iframe_auto_resize"
..

Incude in your application.js

..
//= require jquery.iframe_auto_resize
..

Example:

$(document).ready(function () {
  $('iframe').iframeAutoResize({
    interval: 100,    // ms
    minHeight: 200,   // px
    maxHeight: 800,   // px
    heightOffset: 5,  // px
    animationSpeed: 500,    // in px / s
    maxAnimationTime: 1000, // in ms
    callback: function(){/*...*/},
    debug: false
   });
});

Known Bugs:

  • Issues if margins on iFrames are used

  • Issues with IE if iframe with “frameborder='1'” is used

Jump to Line
Something went wrong with that request. Please try again.