javascriptdrupaldrupal-6drupal-ctools

How do you close a manually created and opened ctools modal in Drupal 6?


Given this code that creates and opens a ctools modal in a Drupal 6 site:

var content = 'my content';
var title = 'my title';
Drupal.CTools.Modal.show();
$('#modal-title').html(title);
$('#modal-content').html(content);
Drupal.attachBehaviors(); 

How do I add a link in content that will close the modal?

Didn't work:

Any ideas what I might be doing wrong?


Solution

  • Try onclick="Drupal.CTools.Modal.dismiss()" instead of .close().