Fancybox - Implementing afterClose callback

adri93

New Member
My javascript syntax is rookie-level, but I'm learning :>I'm using Fancybox 2.1.4 to reveal an inline \[code\]<div id="content">\[/code\].Traditionally, the \[code\]<div>\[/code\] would be set to \[code\]style="display:none"\[/code\] and Fancybox will change that to block when activated, and back to \[code\]none\[/code\] when closed.In my case, I actually have the content of that \[code\]<div>\[/code\] visible on the page in a different location (it's the right thing for the project, I know there are various opinions that can be had there).So I need to keep \[code\]<div id="content">\[/code\] from disappearing after closing the fancybox (which it natively disappears).After some research, I found that using the \[code\]afterClose\[/code\] callback, I can simply change or add the inline style of \[code\]id"content"\[/code\] to \[code\]display:block\[/code\] (which solves the problem.The problem... is my rookiness :>I tried for quite a long time and just not sure where to put the code, and the right syntax.How would i add that \[code\]afterClose\[/code\] to my fancybox function?\[code\]<script type="text/javascript"> $(document).ready(function() { $(".fancybox").fancybox( ); }); </script>\[/code\]Thanks very much for any assist
 
Back
Top