Created
June 22, 2012 07:14
-
-
Save dhavaln/2970945 to your computer and use it in GitHub Desktop.
jQuery iFrame Draggable Test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>jQuery iFrame Draggable Test</title> | |
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script> | |
<script type="text/javascript" src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script> | |
<link rel="stylesheet" type="text/css" href="/css/normalize.css"> | |
<link rel="stylesheet" type="text/css" href="/css/result-light.css"> | |
<style type='text/css'> | |
</style> | |
<script type='text/javascript'>//<![CDATA[ | |
</script> | |
<div id="draggable1">this is outside iframe</div> | |
<script src="http://debug.phonegap.com/target/target-script-min.js#jsf_dvk"></script> | |
</head> | |
<iframe id="frame" src="index1.html" height="400px" width="400px"> | |
</iframe> | |
<!--<iframe id="frame1" src="http://jsfiddle.net/m/auw/" height="400px" width="400px"></iframe> | |
<button id="makeDraggable">Make Draggable</button>--> | |
</body> | |
<script type="text/javascript"> | |
$("#draggable1").draggable(); | |
$("#makeDraggable").click(function(){ | |
console.log("making draggable"); | |
//$("#frame").find("#draggable2").draggable({iframeFix: true}); | |
//$('#frame').contentWindow.makeDraggable("#draggable2"); | |
//document.getElementById('frame').contentWindow.makeDraggable("#draggable2"); | |
$(document.getElementById("frame").contentWindow.document.getElementById("draggable2")).draggable({iframeFix: true}); | |
//$(document.getElementById("frame1").contentWindow.document.getElementById("draggable3")).draggable({iframeFix: true}); | |
}); | |
</script> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title> - jsFiddle demo</title> | |
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script> | |
<script type="text/javascript" src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script> | |
<link rel="stylesheet" type="text/css" href="/css/normalize.css"> | |
<link rel="stylesheet" type="text/css" href="/css/result-light.css"> | |
<style type='text/css'> | |
</style> | |
<script type='text/javascript'>//<![CDATA[ | |
$(window).load(function(){ | |
$(document).ready(function(){ | |
$("#draggable1").draggable(); | |
}); | |
});//]]> | |
</script> | |
<script src="http://debug.phonegap.com/target/target-script-min.js#jsf_dvk"></script></head> | |
<body> | |
<div id="draggable1"> | |
this is draggable | |
</div> | |
<div id="draggable2"> | |
this is draggable 2 | |
</div> | |
<script> | |
function makeDraggable(id){ | |
$(id).draggable(); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment