[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1183
  • Last Modified:

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
0
altariamx2003
Asked:
altariamx2003
  • 5
  • 3
3 Solutions
 
altariamx2003Author Commented:
anyone?
0
 
altariamx2003Author Commented:
Why my question is neglected?
0
 
lenamtlCommented:
Have you tried this:

afterShow: function(){
        $("div.fancybox-wrap").easydrag();

Easydrag plugin: http://www.gildasp.fr/exp/easydrag/
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
altariamx2003Author Commented:
that didnt work
0
 
GaryCommented:
Are you using jQuery UI at all?
You mention it.
Don't know what beforeclose has to do with it?
0
 
GaryCommented:
Quick test seems work fine with jQuery UI

http://jsfiddle.net/GaryC123/M9KAm/19/

    $('.fancybox').fancybox({
        afterShow: function () {
            $(".fancybox-wrap").draggable();
        }
    });

Open in new window

0
 
altariamx2003Author Commented:
do you have an example about how to to use it with iframe fancybox that calls a page?
0
 
altariamx2003Author Commented:
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
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now