SimpleModal -- Open OnLoad
- by Bill Griffith
I'm new to JQuery -- not new to javascript.
Was able to open the OSX STYLE DIALOG using the hyperlink button provided in the demo index.html page, but would like to open it on the page load. I read a couple links on StackOverflow (http://stackoverflow.com/questions/1611727/how-do-i-invoke-a-simplemodal-osx-dialog-on-page-load), but still could not get it to work in the exact same index.html page. I finally resorted to a stopgap measure by programmatically invoking the button click of a hidden button element -- see following fragment:
onLoad="document.getElementById('load_OSX_Example').click();">
<input type="hidden" id="load_OSX_Example" value="" class='osx'>
<script type="text/javascript" language="javascript">
//#### open the OSX Modal ##########
$(document).ready(function(){
$("#osx-modal-content").modal();
});
</script>
So I have two questions:
How can you invoke the class='osx' using javascript/html programmatically?
Why won't this work using the $("#osx-modal-content").modal(); call in javascript (see fragment above)? I tried this in multiple browsers, and the only content that displayed on the screen was content of this tag: "div id="osx-modal-title", and there was no error in the jscript console.