Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fire iframe type magnificPopup programmatically

I'm trying to figure out how to implement magnific popup from the onItemClick event of jquery.gantt. Fortunately, it lets us implement code via a self executing function which it passes data to from the clicked element.

What I'm having issues with now is building the appropriate call to magnific popup in order to load an iframe type popup via jquery. I've tried it a few different ways and unfortunately because I don't have a solid fundamental understanding of either of these jquery plugins (nor jquery for that matter), I'm playing at monkey-see monkey-do.

function(data) {
    $.magnificPopup({type: 'iframe',
        iframe: { src: 'http://server/page.aspx?id=' + data}
    }).magnificPopup('open');
}

This seems close. I get type error: $.magnificPopup is not a function when I try to fire this function. How can I fire an iframe type popup born completely out of javascript?

like image 285
Crimius Avatar asked May 29 '13 14:05

Crimius


Video Answer


1 Answers

$.magnificPopup.open({
  items: {
    src: 'something.html'
  },
  type: 'iframe'
});

http://dimsemenov.com/plugins/magnific-popup/documentation.html#public-methods

like image 176
Dmitry Semenov Avatar answered Oct 07 '22 18:10

Dmitry Semenov