I have been looking up javascript/iFrame posts on StackOverflow for about 45 minutes and I've gathered some great resources, however I cannot get the javascript to function correctly inside an iFrame. I've attached two screenshots from a website that I have iFramed inside my own. The iFrame pops up with a menu open that takes up 60% of the frame. I'd like to add a class to the menu to close it automatically upon my page loading. I've got the right JS, I think, but I can't get it to function. The class will not add at all.
This is my iFrame and Javascript to change the div ID to "expanded" class. I know it sounds silly, but expanded is the class name for the closed menu. Any help would be appreciated! Thanks.
<iframe src="http://dayzdb.com/map#2.065.045" style="width:500px; height:300px;" id="dayzdb"></iframe>
<script>$("#dayzdb").contents().find("#mapContainer").addClass("expanded")</script>
In lieu of posting the HTML (since it's long) I have posted the website link where you can inspect element on the navbar to see it.