Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Joseph Wagner
Android Development Techdegree Graduate 27,137 PointsJquery: Append iframe, show on ready
I am appending an iframe, google map, on a click, but I don't want the iframe to show until it's fully loaded.
I have a css rule for the iframe as display none, so I just need to show after the appended iframe is fully loaded. What do i need to select, which methods are best to use for this?
Thanks!
3 Answers

robert bryan
7,255 PointsHopefully this answers your question: http://jsfiddle.net/pwqd442L/2/
".ready(), Specify a function to execute when the DOM is fully loaded".
also i found that using "display:none" messed with how the map was shown.

robert bryan
7,255 PointsYeah you are so right, i researched it a bunch but i am totally stumped at my current level of understanding. also it looks like it can be really complicated. :(

Joseph Wagner
Android Development Techdegree Graduate 27,137 PointsThanks for the help Robert.
The map I have has a lot of data points on it, so when it initializes on the append the screen does a weird transition, first downloads the frame, then the map background, it takes a few seconds to fully initialize.
Whereas if I load on page start but display none, and then change css on click there is no load because it's already loaded.
I know there is the load method, but that's for ajax requests and I don't think it applies here. And ready doesn't either because that's just for the first page load, right?
Thanks