views:

27

answers:

1

Hi I am trying to create one draggable iframe and got success in that but problem is if i pass pdf or doc file to iframe location like parent.frames.iframe2.location='file://test.pdf' am not able to move iframe from position and iframe not showing selectable area for drag.

+1  A: 

javascripttoolbox.com/lib/dragiframe

This library relies on frame contents being HTML, and being on the same host as the parent document, so that it can add click-handling events to the child document. That's absolutely not possible when the child document is handled by a plugin such as Word or Reader which does not expose mouse interaction in its content area to JavaScript control. You'll also see similar problems if, for example, the child document contains a Flash embed: clicks in the Flash will not propagate to the JavaScript event handler on document.

You will have to instead place a transparent cover <div> over the top of the iframe, obscuring it and grabbing all clicks. Then when it is dragged, you move both the div and the iframe that's z-indexed underneath it, making it look as though you're dragging the iframe.

bobince
could u please suggest me some javascript and css sample code it will helpful to me
prakashkadakol