overlay does not work after enabling my custom module
I figured (googled) it out. :)

I added my custom js in my custom module's info file instead of using drupal_add_js in my module directly.


scripts[] = my_module.js


and added drupal behaviors in my js file as well, so now my custom js looks like below


(function ($) {
Drupal.behaviors.my_module = {
attach: function (context) {

// my js code

 }
};
})(jQuery);


I spent many hours figuring this out but it was as simple as could be be.

Hope this helps someone! :)