0

I have an iFrame that points out to a page with jQuery autocomplete function. This works fine. However, I'm not able get the results out of the iframe, above other things.

When I type something, it creates a scrollbar and the results appear inside the iframe. I'd like the dropdown window appear above other things.

My code is: http://jsfiddle.net/4JvT9/ (type test)

<iframe src='http://www.corridadeformula1.com/f1-mania-busca/' frameborder="0" id="my_iframe" onload="resizeCrossDomainIframe('my_iframe', 'http://www.corridadeformula1.com');">

function resizeCrossDomainIframe(id, other_domain) {
    var iframe = document.getElementById(id);
    window.addEventListener('message', function(event) {
        if (event.origin !== other_domain) return; // only accept messages from the specified domain
        if (isNaN(event.data)) return; // only accept something which can be parsed as a number
        var height = parseInt(event.data) + 0; // add some extra height to avoid scrollbar
        iframe.height = height + "px";
    }, false);
};

Any ideas?

Fractaliste
  • 5,116
  • 8
  • 36
  • 75
brians69
  • 405
  • 1
  • 11
  • 23
  • probably duplicate with [http://stackoverflow.com/questions/701339/resizing-iframe-to-fit-its-content](http://stackoverflow.com/questions/701339/resizing-iframe-to-fit-its-content) – Axel Amthor Jan 25 '14 at 16:29
  • That doesn't work with jQuery autocomplete function... – brians69 Jan 25 '14 at 16:46
  • There is absolutely no jQuery call in the above code? – Axel Amthor Jan 25 '14 at 16:55
  • The jQuery is in the iFrame. I got the resize function to work cross-domain with the function above. However, it's not working for the jQuery autocomplete inside the iFrame. If you open the jsfiddle example, you'll get a better understanding of what's going on. Thanks! – brians69 Jan 25 '14 at 16:59

0 Answers0