fancybox Plugin for jQuery
From fancybox.net: FancyBox is a tool for displaying images, html content and multi-media in a Mac-style "lightbox" that floats overtop of web page. Here I trigger a fancybox to open by code rather than a user click.
by webdevem
HTML
<script src="http://fancyapps.com/fancybox/source/jquery.fancybox.js"></script>
<link rel="stylesheet" href="http://fancyapps.com/fancybox/source/jquery.fancybox.css">
<a class="fancyTrigger" href="#TheFancybox"></a>
<hr>
<div id="TheFancybox"></div>
Powered by <a href="http://fancybox.net/" target="_blank">Fancybox</a>
CSS
/* Note that the fancybox css file is loaded under the
"Add Resources" tab to the left. Normally you would load it in your <head> */
body {
background-color: #eef;
}
#TheFancybox {
display: none;
}
JavaScript
// Note that the fancybox js file is loaded under the
// "Add Resources" tab to the left. Normally you would load it in your <head>
$("#TheFancybox").html("<p>Just adding a paragraph to demonstrate that you can dynamically create HTML content within a DIV using .html()</p>");
$(".fancyTrigger").fancybox();
$(".fancyTrigger").trigger('click');