I have been attempting to use a Dojo moveable with a fixed position on the browser window. Unfortunately, whenever I try to move the div using the mouse, the position automatically changes to absolute. Is there a way to keep the div fixed in its position?
Here is the HTML code:
<html>
<body>
<div id="moveMe" style="position:fixed;width:100px;height:100px;border:1px solid black;background-color:#00ff00;cursor:pointer;">bla</div>
<p>test<br>test<br>test<br>test<br>test<br>test<br>test<br>
test<br>test<br>test<br>test<br>test<br>test<br>test<br>
test<br>test<br>test<br>test<br>test<br>test<br>test<br>
test<br>test<br>test<br>test<br>test<br>test<br>test<br>
test<br>test<br>test<br>test<br>test<br>test<br>test<br>
</body>
</html>
And here is the script:
dojo.require("dojo.dnd.move");
dojo.ready(function(){
var pcm = new dojo.dnd.move.boxConstrainedMoveable(dojo.byId("moveMe"), {
box : dojo.window.getBox(),
within : true
});
});
If you want to test it out, you can click on this link: http://jsfiddle.net/zPVdX/
Thanks, krater