it's possible to put text content into a frame, and show in lightbox, instead show images? How can I do it?
i tried
<a class="iframe" href="/folder/file.txt"><img height="80" width="120" src="img/txtFile.png"</a>
and in jquery
<script type="text/javascript">
$("a.iframe").fancybox({
'width': 640, // or whatever you want
'height': 480, // or whatever you want
'type': 'iframe'
});
</script>
Fancybox is able to display multiple types of content. See their documentation for more information. This includes inline content (ie displaying a hidden element, like a div), loading an iframe, or displaying an ajax response. The examples section can help clarify a lot of this for you.
If you want to read from a txt file, it may be more appropriate to load the data via ajax, as opposed to loading it into an iframe.
I've copied the relevant documentation from the documentation link listed above, for posterity (you can view the example in this codepen demo that the fancyapps team setup):
Ajax
To load content via AJAX, you need to add a
data-type="ajax"
attribute to your link:<a data-fancybox data-type="ajax" data-src="my_page.com/path/to/ajax/" href="javascript:;"> AJAX content </a>
Additionally it is possible to define a selector with the data-filter attribute to show only a part of the response. The selector can be any string, that is a valid jQuery selector:
<a data-fancybox data-type="ajax" data-src="my_page.com/path/to/ajax/" data-filter="#two" href="javascript:;"> AJAX content </a>