You can use the cursor
property of css
, for hover
use grab
for active
use grabbing
, example ...
div {
width: 150px;
height: 150px;
background: green;
cursor: grab;
cursor: -webkit-grab;
cursor:-moz-grab;
}
div:active {
cursor: grabbing;
cursor: -webkit-grabbing;
cursor:-moz-grabbing;
}
<div></div>
To simulate in a iframe
, it is necessary to put a layer on top thus giving the desired effect ...
.wrapper {
position: relative;
}
.grab-cursor {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
cursor: grab;
cursor: -webkit-grab;
cursor:-moz-grab;
z-index: 100;
}
.grab-cursor:active {
cursor: grabbing;
cursor: -webkit-grabbing;
cursor:-moz-grabbing;
}
<div class="wrapper">
<iframe src="http://doc.jsfiddle.net/"></iframe><divclass="grab-cursor"></div>
</div>
You can also do with javascript, to set yourself in a specific place in the iframe ...
var iframe = document.querySelector('iframe');
var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
iframeDoc.body.style.cursor = 'move'; //no body