jtsage/jquery-mobile-simpledialog

show dialog by code

smallwind1912 opened this issue · 1 comments

I want to use simpledialog show by javascript code just look like when we call alert() function
I only know use simpledialog show when user click
Any body can tell me how to do that?
Thank you

Any time you call simpledialog({ ... }) it will open a dialog - when I want to do general popups, I usually use something like:

var first = $('.ui-page-active').first('.ui-content');

first.simpledialog({ ... });

Note: cleanOnClose: true is your friend here, however, if you allow dialog mode, things go poorly - either disallow dialog (useDialogForceFalse: true) or, use fullscreen instead (fullScreen: true)
This is an older example of calling it as a function: http://dev.jtsage.com/jQM-SimpleDialog/js/jquery.mobile.simpledialog.wrapper.js

Note that it would be better to use the 'cleanOnClose' option, and omit any references to sbCleanUp in that example.