IE auto content fit IFrame HACK

I ran into 'another' strange IE-browser behavior yesterday. It took me an hour of two to solve this iframe-height-problem.

If you call this.document.body.scrollHeight in an iframe twice, the first value is wrong, but the second value is okay.

Look at the example below:


    function autoFitIFrame(elementId){
        if (!window.opera && !document.mimeType && document.all && document.getElementById){
            parent.document.getElementById(elementId).style.height=this.document.body.offsetHeight+"px";
        }
        else if(document.getElementById) {
            // ErnestoZ HACK: if you call scrollHeight TWICE, the second value is the real height of the iframe
            var scrollHeightWrong = this.document.body.scrollHeight;
            var scrollHeight = this.document.body.scrollHeight;
            alert(scrollHeightWrong);
            alert(scrollHeight);
            parent.document.getElementById(elementId).style.height = scrollHeight+"px";
        }
    }

ColdBox Spry Plugin 2.0 Released

I've updated the ColdBox Spry Plugin to version 2.0

spryexample

New implementations due many user requests:

  • TextField Validation
  • TextArea Validation
  • Radio Validation
  • Checkbox Validation
  • Select Validation
  • Password Validation
  • Confirm Validation

I also added effect examples to the Spry live sample application.

Download Spry Plugin + Sample App

ColdBox SPRY plugin version 1.6

New methods added:

  • setIsUtils : for using Spry utilities
  • setIsJSONDataSets : for using dataset creation in js and not through method setJSONDataSet
  • setIsNestedJSONDataSet : ..... not through method setNestedJSONDataSet
  • setIsXMLDataSet : ..... not through method setXMLDataSet
  • setIsNestedXMLDataSet : ..... not through method setNestedXMLDataSet

Enjoy!

Any question? Post them in the ColdBox forums!

Download ColdBox Spry Plugin

ColdBox SPRY plugin version 1.5

Just updated the ColdBox Spry plugin.

New features:

- White space management

- JS output minified

Download ColdBox Spry Plugin version 1.5 

Spry PLUGIN for ColdBox

You want to use Spry in a ColdBox based application? Me too, this is why I developed a Spry Plugin for ColdBox.

Luis asked me to put it on RiaForge, so I did. It's wating for approval, so for getting you started:

Live demo | Download sample

Please note that you can do a lot more with Adobe Spry than what's included in the demo.

Enjoy!

PS Any recommedations are welcome!!

BlogCFC was created by Raymond Camden. This blog is running version 5.9.004.