take a screen shot of a image within a div using js
<!doctype html>
<html>
<head>
<script type="text/javascript" src="html2canvas-master/dist/html2canvas.js"></script>
</head>
<body>
<h1>Take screenshot of webpage with html2canvas</h1>
<div class="container" id='container' >
<img src='images/image1.jpg' width='100' height='100'>
<img src='images/image2.jpg' width='100' height='100'>
<img src='images/image3.jpg' width='100' height='100'>
</div>
<input type='button' id='but_screenshot' value='Take screenshot' onclick='screenshot();'><br/>
<!-- Script -->
<script type='text/javascript'>
function screenshot(){
html2canvas(document.body).then(function(canvas) {
document.body.appendChild(canvas);
});
}
</script>
</body>
</html>
Also in JavaScript:
- mdn select event
- react fun tion
- jquery table row calculation
- for each array javascript
- javascript submit form when enter key pressed
- csv export in react
- how to change the font family using jquery
- https with express
- vue store access state in actions
- devexpress dxdatagrid custom text field link
- page reload timeout
- christmas
- for in javascript
- Material-ui snowflake icon
- get query param javascript
- how to get value of button that click on it jquery
- tilt js vue
- js export multiple functions
- get jquery version from console
- cannot use wildcard in access-control-allow-origin when credentials flag is true
- setinterval jquery
- useReactiveVar
- ejs comments
- badlion client