开发者

draggable iframe

开发者 https://www.devze.com 2023-01-16 10:04 出处:网络
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

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消