Magnific popup to open after the page is loaded

Magnific popup to open after the page is loaded

Dear Sir

I want to open an Image using magnific popup after load of a web page

I used code from

in web page 

It does not work

My code

  1. <script>
  2. (function($) {
  3.     $(window).load(function () {
  4.         alert('code to open Magnific Popup after page load');
  5. // retrieved this line of code from http://dimsemenov.com/plugins/magnific-popup/documentation.html#api
  6.         $.magnificPopup.open({
  7.             items: {
  8.                 src: 'Bull_and_bear.jpg'
  9.             },
  10.             type: 'image'

  11.           // You may add options here, they're exactly the same as for $.fn.magnificPopup call
  12.           // Note that some settings that rely on click event (like disableOn or midClick) will not work here
  13.         }, 0);
  14.     });
  15. })(jQuery);
  16. </script>

The dummy alert 

  1. alert('code to open Magnific Popup after page load');
 works after web page is loaded

I will like to know why the said popup is not working

The code is also specified in


Under heading   Public Methods