Skip to content
a wrapper that encapsulate the jquery plugin(iframeAutoHeight) for yii
JavaScript PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
iframeAutoHeight
README.md

README.md

yii-iframeAutoHeight

wrapper the jquery plugin(iframeAutoHeight) for yii

usage example :

<?php $this->widget('ext.iframeAutoHeight.IFrameAutoHeight', array( //'debug' => false , 'selector'=>'iframe' ,// the css selector which select the target iframe you want apply this plugin to 'callback'=>'js: function(callbackObject) { var m = "new size is " + callbackObject.newFrameHeight; window.console && console.log(m) || alert(m); // you can use "this" to refer the target iframe obj }' ) ); ?> </p> <h1>read me</h1> <p>this is a wrapper for the jquery-iframe-auto-height(<a href="https://github.com/house9/jquery-iframe-auto-height" title="jquery-iframe-auto-height">jquery-iframe-auto-height on github</a>) plugin</p> <p>which can set the height of an iframe to its contents height .</p> <p><strong>note:</strong> now it can&#39;t handle the cross domain url .</p> <h2>Requirements</h2> <p>test it on yii 1.1.10 , should work with other versions ..</p> <h2>Usage</h2> <p>extract it to protected/extensions dir . (actually any dir if you want ) and then in your view file which contain the iframe you want to manipulate</p> <pre><code>[php] &lt;?php $this-&gt;widget(&#39;ext.iframeAutoHeight.IFrameAutoHeight&#39;, array( //&#39;debug&#39; =&gt; false , &#39;selector&#39;=&gt;&#39;iframe&#39; ,// the css selector which select the target iframe you want apply this plugin to &#39;callback&#39;=&gt;&#39;js: function(callbackObject) { var m = &quot;new size is &quot; + callbackObject.newFrameHeight; window.console &amp;&amp; console.log(m) || alert(m); // you can use &quot;this&quot; to refer the target iframe obj }&#39; ) ); ?&gt; &lt;iframe src=&quot;http://localhost/my/yiiSpace/&quot; name=&quot;contentFrame&quot; id=&quot;contentFrame&quot; width=&quot;100%&quot; height=&quot;800px&quot;/&gt; </code></pre> <pre><code>[php] $(&quot;#contentFrame&quot;).attr(&quot;src&quot;,&quot;anotherUrl&quot;); </code></pre> <h2>Resources</h2> <p>...external resources for this extension...</p> <ul> <li><a href="https://github.com/house9/jquery-iframe-auto-height">jquery-iframe-auto-height on github</a></li> <li><a href="https://github.com/yiqing-95/yii-iframeAutoHeight">yii-iframeAutoHeight</a></li> <li><a href="http://sonspring.com/journal/jquery-iframe-sizing">original plugin</a></li> </ul>

Something went wrong with that request. Please try again.