Loading fancybox from Jquery how can I retrieve the contents of a div ID on a page and not the whole page. This is my code so fare which gets me the whole page:
The index view(this links to the show view of styel):
<div class="style_image"> <%=link_to (image_tag style.cover.pic.url(:normal)), style %></div>
The show view (I want to to appear in the fancybox):
<div id="show_style">
ALL THE CONTENT!
</div>
application.js:
$(function() {
$(".style_image a").live('click', function(event) {
$(".style_image a").fancybox();
return false;
});
});
I have also tried the following with no success:
$(function() {
$(".style_image a").live('click', function(event) {
$(".style_image a" + "#show_style").fancybox();
return false;
});
});
I'm not sure how this is done as there is little info on the fancy box docs. I wish this to be done dynamically not inline.