Link to home
Start Free TrialLog in
Avatar of altariamx2003
altariamx2003Flag for Mexico

asked on

it is possible to make fancybox2 draggable?

I would like to know if it is possible to make fancybox draggable

I use this fancybox2 to open a new page to do something and when the user close the fancybox window it returns a value
this is the code:
<script type="text/javascript">
 var temporal;
 $(document).ready(function() 
 {&#9; 
$(".various").fancybox(
  {
   maxWidth : 800,   maxHeight   : 700,   fitToView   : false,
   width    : '70%', height      : '90%', autoSize : false,
   closeClick  : false,   openEffect  : 'fade',
   beforeClose : function()
   {
&#9; if($('.fancybox-iframe').contents().find('#lautor').val() != "")
&#9; { 
&#9;   document.getElementById('titulo').value = $('.fancybox-iframe').contents().find('#ltitulo').val(); 
&#9;   document.getElementById('autor').value = $('.fancybox-iframe').contents().find('#lautor').val(); 
           document.getElementById('lista').value = 1;
&#9; }
&#9; else { document.getElementById('lista').value = 0; }                  &#9;
   }
  });
 });
</script>

Open in new window

<a class="various fancybox.iframe" data-fancybox-type="iframe" style="text-decoration:none;" href="buscar.php">
               <input class="tabs" type="button" style="text-decoration:none;" value="Buscar"></a>

Open in new window


My code works without a problem, but yesterday I found this amazing pluging: http://jquery.diaz-cornen.com/fancybox/index_dragfancybox.html

I tried to integrate to my code but it only works when I use a previouse version of Fancybox and this is a problem because "beforeclose function" only works for me in fancybox2

I found also that jquery ui has a jquery ui draggable but i cannot found any example about how to use it with fancybox

Thats way I was wondering if it is possible to make fancybox2 draggable

best regards
Avatar of altariamx2003
altariamx2003
Flag of Mexico image

ASKER

anyone?
Why my question is neglected?
SOLUTION
Avatar of lenamtl
lenamtl
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
that didnt work
Are you using jQuery UI at all?
You mention it.
Don't know what beforeclose has to do with it?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
do you have an example about how to to use it with iframe fancybox that calls a page?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
your idea is great, I gonna used with the galleries that I display using fancybox 1.X

unfortunately it didnt works with fancybox 2.x, but anyway Im gonna used instead jquery ui dialog

thanks anyway