Display Magnific Popup using AJAX on Page Load

Display Magnific Popup using AJAX on Page Load

Dear Sir/Madam

I found a solution to display an Image on pageload



and used it successfully 

in following program



Code to display image on page load

  1. (function($) {
  2.     $(window).load(function () {
  3.         // retrieved this line of code from http://dimsemenov.com/plugins/magnific-popup/documentation.html#api
  4.         $.magnificPopup.open({
  5.             items: {
  6.                 src: 'images/header.jpg'
  7.             },
  8.             type: 'image'

  9.           // You may add options here, they're exactly the same as for $.fn.magnificPopup call
  10.           // Note that some settings that rely on click event (like disableOn or midClick) will not work here
  11.         }, 0);
  12.     });
  13. })(jQuery);
which is working fine 

  I tried

  1. (function($) {
  2.     $(window).load(function () {
  3.         // retrieved this line of code from http://dimsemenov.com/plugins/magnific-popup/documentation.html#api
  4.         //$.magnificPopup.open({
  5.          $('.simple-ajax-popup').magnificPopup({
  6.           type: 'ajax'
  7.         });    

  8.           // You may add options here, they're exactly the same as for $.fn.magnificPopup call
  9.           // Note that some settings that rely on click event (like disableOn or midClick) will not work here
  10.         }, 0);
  11.     });
  12. })(jQuery);
But could not succeed
 
pls hlp

-----------------------------------------------------------------------------------------------------------------------------------------

for your information
 
abcd.php is given below
  1. <table width="100%" border="0" cellspacing="0" cellpadding="0" style="background-color:#fff" align="center">
  2.   <tr>
  3.     <td style="height:auto;">&nbsp;<?php 
  4. echo 'Call a abcd.php on page load';
  5. ?></td>
  6.   </tr>
  7. </table>

  8.  
 
    • Topic Participants

    • vikas