Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="container" style="border: solid 1px Black; padding: 10px 10px 10px 10px; height: 520px; width: 420px;">
- <iframe id="if" src="http://google.com" style="width: 400px; height: 500px;"></iframe>
- </div>
- <script type="text/javascript" src="jquery-1.2.6.js"></script>
- <script type="text/javascript" src="jquery.ui.all.js"></script>
- <script type="text/javascript">
- $(document).ready(function()
- {
- $("#container").draggable();
- $("#container").resizable(
- {
- alsoResize: "#if"
- }
- ).parent().draggable();
- }
- );
- $elements.resizable({ //mark it as resizable
- containment: "#docCanvas",
- start: function(event, ui) {
- //add a mask over the Iframe to prevent IE from stealing mouse events
- $j("#docCanvas").append("<div id="mask" style="background-image:url(images/spacer.gif); position: absolute; z-index: 2; left: 0pt; top: 0pt; right: 0pt; bottom: 0pt;"></div>");
- },
- stop: function(event, ui) {
- //remove mask when dragging ends
- $j("#mask").remove();
- }
- });
- <div id="docCanvas" style="position: relative;">
- <iframe src="something.html"></iframe>
- </div>
- // this will make <div id="box"> resizable() and draggable()
- $('#box').resizable().parent().draggable();
- // same but slightly safer since it checks parent's class
- $('#box').resizable().parent('.ui-wrapper').draggable();
- function uncoverIframes() {
- $(".cover").remove();
- }
Add Comment
Please, Sign In to add comment