HTML div截图? [英] HTML div to screenshot?

查看:187
本文介绍了HTML div截图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图谷歌它,但没有太大的成功。



这是我的问题:

我有一些东西,在jQuery中放置游戏,用户将一些项目(div与img)拖到可拖放的绘图区域。



我需要用户设计的截图,以便将所有设计成一个图库页面。



我的问题是如何将HTML代码转换为jpeg / png / gif / canvas / whatever。

Btw 。我在服务器端共享PHP托管。

解决方案

你做错了。在JavaScript中始终存储每件作品的位置,然后提交该数据并根据传递的JavaScript数据重新构建图像/位置。


I tried to google it, but without much success.

Here is my problem:
I have something like a drag-and-drop game in jQuery, where the user drags some items (div with img) to the droppable drawing area.

I need a screenshot of the users design so I can put all designs into a gallery page.

My problem is how to get the HTML code into a jpeg/png/gif/canvas/whatever.
Btw. I'm on a shared PHP hosting on the server side.

解决方案

You're doing it wrong. Store each piece's location at all times in javascript, and then just submit that data and re-build the images/locations based on the passed javascript data.

这篇关于HTML div截图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆