私のプロジェクトでは、ボタンを押すと画像をポップアップする必要があります。SimpleDialogプラグインを使用しようとしています。これはここで確認できます。私は自分の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>
JSとCSSを適切に含めました。しかし、何らかの理由でそれは機能しません。誰かアイデアがありますか?または、SimpleDialogプラグインの他の代替手段ですか?
敬具
------編集-------OK上記の例で動作するようになりました。でも今は画像だけを見せたいです。だから私は私のスクリプトでこれを行います。
$(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" />"
})
})
しかし、これは機能しません。誰でも助けることができますか?