I have a onclick event like this:
function OnVisClicked() {
$("#overlay").animate({opacity: "toggle",width: "3000px",height: "3000px"}, 300);
$('<iframe />', {
name: 'myFrame',
id: 'mytFrame',
width: 724,
height: 535,
frameborder:"0",
scrolling: "no",
allowTransparency: "true",
src: "the link..."
}).appendTo('.myDiv').ready(function(){
$(".myBigDiv").show();
});
$("#someOtherDiv").css("display", "none");
}
Originally myBigDiv
was set to display:none
.
After I clicked on my button, the myFrame
is successfully appended to myDiv
. But myBigDiv
was still display:none
. I added a breakpoint inside the ready()
but clearly the program didn't entered into it.
Addtional information after I got the answer and the solution:
My DOM cannot be fully loaded because of other web parts on the page, so ready()
can never be called.