You can use the property cursor
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 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>
<div class="grab-cursor"></div>
</div>
It can also be done with javascript, to set in a specific place of iframe...
var iframe = document.querySelector('iframe');
var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
iframeDoc.body.style.cursor = 'move'; //no body
The guy wants to move a div, I want to move elements inside an iframe
– Luiz Gustavo Costa Ceolin