reformat index
This commit is contained in:
parent
b3463378e9
commit
92ee92d636
|
@ -115,41 +115,7 @@
|
|||
</div>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript" src="../assets/mdb.min.js"></script>
|
||||
<script>
|
||||
function createElement(type, callback) {
|
||||
var element = document.createElement(type);
|
||||
callback(element);
|
||||
return element;
|
||||
}
|
||||
|
||||
function freezeGif(img) {
|
||||
var width = img.width,
|
||||
height = img.height,
|
||||
canvas = createElement('canvas', function (clone) {
|
||||
clone.width = width;
|
||||
clone.height = height;
|
||||
}),
|
||||
attr,
|
||||
i = 0;
|
||||
|
||||
var freeze = function () {
|
||||
canvas.getContext('2d').drawImage(img, 0, 0, width, height);
|
||||
|
||||
for (i = 0; i < img.attributes.length; i++) {
|
||||
attr = img.attributes[i];
|
||||
|
||||
if (attr.name !== '"') {
|
||||
canvas.setAttribute(attr.name, attr.value);
|
||||
}
|
||||
}
|
||||
|
||||
canvas.style.position = 'absolute';
|
||||
|
||||
img.parentNode.insertBefore(canvas, img);
|
||||
img.style.opacity = 0;
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user