Since everybody is off partying or doing other things, I'll throw a few
hints your way...
1) drop the onload!
2) your iframe with id iframe is not in a div , so the code won't find it!
you want $("#iframe")
3) you don't need charset for inline <script>s
4) you have</script></script> in the iframe
5) I would put all the functions the main page, and then inside the iframe
say:
if (parent.setHeight) parent.setHeight($('#content').height()); //
again there is no div tag so you don't want it
6) the only time you need "// <![CDATA[" is when you are trying to
protect extremely old browsers from showing the contents of the script
or when you are going to use < instead of & lt; or & instead of & amp;
7) if you put all the iframe's code into a
$(function(){
} block you can put it all in the head... it won't execute until the
dom is loaded.
No guarantees that it's enough to make it work... but it's a start
good luck!
On 12/2/06, meekish <[EMAIL PROTECTED]> wrote:
I already posted about this, but it was a bit of a half-hearted post and
(big
surprise) no one replied.
So let's try this again...
Here's what I need to do:
I am using an iframe on my web site to display other pages on my site. So,
I
have full control over the parent page and the page in the iframe. I would
like to use only the browser's main scroll bar for scrolling the content.
So, if a very long page loads into the iframe, I need jQuery to expand the
height of the iframe to enclose the content and prevent the iframe from
displaying a scrollbar. I did find this functionality implemented using
vanilla JS, but the code is not cross-browser compatible.
(http://www.dyn-web.com/dhtml/iframes/height.html)
I gave it a go using jQuery and didn't get very far (I've never used
jQuery
before). Here's what I came up with:
parent page: http://pastie.caboo.se/25487
child page (iframe content): http://pastie.caboo.se/25488
The code I came up with really doesn't work. I tested it in Safari and FF
and got various undesired results (scroll bar in iframe doesn't disappear,
Safari sizes iFrame height larger/smaller than FF, etc...).
So, consider this second post my whole-hearted plea for help. My deadline
looms
--
View this message in context:
http://www.nabble.com/Scripting-Iframes-tf2745384.html#a7659820
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
--
Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/