SimpleModal can't bind event onShow
- by Higgs Boson
Hi All
I can't seem to get this working, some help would be greatly appreciated.
I have a page with the following code:
$('.editname').click(function (e) {
var src = "test.html";
$.modal('<iframe src="' + src + '" height="480" width="640" style="border:0">', {
closeHTML:"<div class='no simplemodal-close'>Close</div>",
containerCss:{
backgroundColor:"#fff",
border:"10px solid #333",
height:480,
padding:"10px",
width:640
},
opacity:50,
overlayCss: {backgroundColor:"#fff"},
onShow: function (dialog) {
$('.saveit', dialog.data[0]).click(function () {
// close the dialog
$.modal.close();
});
}
});
});
The code for test.html (the contents of the modal window) is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<link href="css/reset.css" rel="stylesheet" type="text/css" />
<link href="css/layout.css" rel="stylesheet" type="text/css" />
<link href="css/text.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Test</h1>
<div class='pointer spacertop'><a href="#" class="saveit">Save</a></div>
</body>
</html>
The modal window appears, however clicking on the Save button (class saveit) in the modal window does not fire the click function. It does nothing. Please help.
Thank you in advance.