views:

16

answers:

1

I have an iframe that returns data to the top.document window just fine by using:

$("#someDiv", top.document).html(data);

The above works fine. Now I want to be able to hide a div on the top document and I try:

$("#someDiv", top.document).toggle("slow");

It is not working... any ideas?

+2  A: 

Try

top.$('#someDiv').toggle('slow');
Pointy
That worked! What's the difference between top.$("#TB_closeWindowButton").click(); and $("#TB_closeWindowButton", top.document).click(); if you don't mind explaining ? thanks :-)
sjobe
The important part is to use the "jQuery" object that "lives" in the window that you're messing with. In other words, your iframe has its copy of jQuery, but the parent page has a *separate* copy of jQuery, with its own animation timers etc.
Pointy