Question

Could it possible to show inline content in lightbox2 popup? Currently I am using:

<a id='lbpopup' href='/popupcontent.php' rel='lightframe' style='display:none;'>flyover</a>
<script type="text/javascript">
  $(document).ready(function(){
    $('#lbpopup').click();
  });
</script>

By using the above code popup is working, but it using an iframe to load content from the page popupcontent.php

Actually my requirement is :

<html>
  <body>
    <div id='popup-content'>My Popup Content</div>
    <a id='lbpopup' href='#'>Click here</a>
  </body>
</html>

While click on the link #lbpopup, I want to show the content of div #popup-content as popup without using iframe. How can I do that?

I don't want to try any other jQuery popups like fancybox, colorbox etc. I just want to make it with lightbox2 only.

Was it helpful?

Solution

Lightbox2 doesn't seem to have many features. It would be sorta hacky if you want to get inline content to work. Maybe you can try this

https://web-beta.archive.org/web/20151110065936/http://old.joesong.com:80/2010/02/showing-in-page-and-inline-content-in-lightbox2/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top