For my project I need to popup an image when i push a button.
I am trying to use the SimpleDialog plugin, which you can see over here.
I am doing this in my HTML
<p>This shows standard, default popup only mode.</p>
<script type="text/javascript">
$(document).delegate('#popupbut', 'click', function() {
$('<div>').simpledialog2({
mode: 'blank',
headerText: 'Some Stuff',
headerClose: true,
blankContent :
"<ul data-role='listview'><li>Some</li><li>List</li><li>Items</li></ul>"+
"<a rel='close' data-role='button' href='#'>Close</a>"
})
});
</script>
<a href="#" id="popupbut" data-role="button">Open Dialog</a>
I have included the JS and CSS properly. But for some reason it won’t work.
Does anybody have an idea? Or an other alternative for the SimpleDialog plugin?
Kind Regards
——EDIT ——-
OK I got it to work with the example above.
But now I only want to show an image. So I do this in my script.
$(document).delegate('#opendialog', 'click', function() {
// NOTE: The selector can be whatever you like, so long as it is an HTML element.
// If you prefer, it can be a member of the current page, or an anonymous div
// like shown.
$('<div>').simpledialog2({
mode: 'blank',
headerText: 'Some Stuff',
headerClose: true,
blankContent :
"<img src="images/schema.jpg" alt="schema" width="100" height="100" />"
})
})
But this wont work. Anybody can help?
Updated my post, this should work.