views:

39

answers:

4

When dragging a jquery dialog with an iframe inside , the drag stops if the mouse goes over the frame contents while dragging. It seems that the iframe takes automatically the focus. is there any way to prevent this and make drag normal?

var iframe=document.createElement('IFRAME');    
$(div).append(iframe)
       .dialog();
A: 

have you tried setting a z-index for the iframe?

var iframe=document.createElement('IFRAME');    
iframe.css('z-index', '-999');
$(div).append(iframe)
       .dialog();
Christian Smorra
yes i tried it but it doesnt work.
albanx
A: 

Maybe you can hide iframe while dragging?

fantactuka
yes i think this work, but i need to see frame contents
albanx
A: 

It's just my guess, but I'd try covering everything with a transparent div 100% width&height while dragging and assuring it's above iframes and under the dragged thingie :)

naugtur
i have to try this.
albanx
good works, great
albanx
I'm glad it worked. Isn't that a bug in FF? Iframes should bubble, but all bubbling stops on window object I suppose.
naugtur
A: 

from naugtur suggestion i found this good working solution:

dragStart:function(){
    var divt=document.createElement('div');
    $(divt).attr('id','tempdragdiv');
     divt.style.height='93%';
    divt.style.width='100%';
    $(divt).css('position','absolute').css('left','0')  .css('top','0');                    
    $(div).append(divt);//div where is iframe
    },
    dragStop:function(){
        $('#tempdragdiv').remove();
    }
albanx