问题
i just want to add a pan tool within the " iframe " , and i tried by this demo but i cant able to make pan tool in within the iframe. can anyone give any suggestion regarding this.
my html is
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Grab-to-pan.js demo</title>
<link rel="stylesheet" href="grab-to-pan.css" type="text/css">
<style>
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
.scrollable {
overflow: auto;
width: 100%;
height: 100%;
max-width: 300px;
max-height: 300px;
background-color: #EEE;
}
.filler {
width: 200%;
font-size: 100px; /* I don't want to type a huge wall of Lorem ipsum */
}
</style>
</head>
<body>
<label><input type="checkbox" id="activate-g2p" checked> Activate Grab to Pan</label>
<div class="scrollable" id="scrollable-container">
<div class="filler">
Grab to pan - Grab this section with your mouse, and move your mouse around to pan the content.
</div>
</div>
<script src="grab-to-pan.js"></script>
<script>
document.getElementById('activate-g2p').onchange = function() {
if (this.checked) g2p.activate();
else g2p.deactivate();
};
var scrollableContainer = document.getElementById('scrollable-container');
var g2p = new GrabToPan({
element: scrollableContainer, // required
onActiveChanged: function(isActive) { // optional
if (window.console) { // IE doesn't define console unless the devtools are open
console.log('Grab-to-pan is ' + (isActive ? 'activated' : 'deactivated'));
}
}
});
g2p.activate();
</script>
</body>
</html>
here i want to add one iframe ex:www.w3schools.com and under this link i need pan tool(hand).
Thank you
来源:https://stackoverflow.com/questions/21325024/how-to-add-the-pan-tool-within-the-iframe