0

I am trying to work out how to print an image from Magnific Lightbox & came across this excellent answer below.

How do I print the entire bootstrap modal where content in modal body is scrolled out of view

It seems @Abu-Sulaiman has the most popular answer but this newbie can't work out how to link to a button. From my most basic knowledge, the id of the button is used at the start of the function (in this case "#modalDiv") however it appears that the div I'd of their area to be printed is used in that location.

Ive also come across another post thanks to a helpful member but this seems more simpler.

Thanks in advance for any assistance.

Todd

Community
  • 1
  • 1
Todd
  • 43
  • 6

1 Answers1

0

Assuming you are using jQuery (because printThis requires jQuery):

$('#button').on('click', function(){
    $('#myDiv').printThis();
});
Jason
  • 7,612
  • 14
  • 77
  • 127