0

I have an overlay module installed which allows my admin to open in an Overlay (Jquery Pop Up)

I want to run a specific JQuery code whenever admin page opens in an overlay. How can I do that?

Thanks.

0

Implement hook_overlay_child_initialize()

<?php

function YOURMODULE_overlay_child_initialize() {
  drupal_add_js(drupal_get_path('module', 'YOURMODULE') . '/YOURMODULE-overlay.js');
}

?>

and in file YOURMODULE-overlay.js add:

(function ($) {
  Drupal.behaviors.YOURMODULE = {
    attach: function (context, settings) {
      // Your jQuery code here
    }
  };
})(jQuery);
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.