如何在Drupal 6中关闭手动创建和打开的ctools模式?

Jus*_*tin 2 javascript drupal drupal-6 drupal-ctools

鉴于此代码在Drupal 6站点中创建并打开ctools模式:

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

如何在将关闭模式的内容中添加链接?

没工作:

  • 添加类"close"的链接.这就是ctools自动添加到模态的右角关闭链接的工作原理
  • 运用 onclick="Drupal.CTools.Modal.show();"
  • 运用 onclick="Drupal.CTools.Modal.close();"

我有什么想法可能做错了吗?

Ale*_*der 6

尝试onclick="Drupal.CTools.Modal.dismiss()"代替.close().