使用jquery / Javascript将div转换为图像 [英] Convert a div into an image using jquery/Javascript
本文介绍了使用jquery / Javascript将div转换为图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个包含一些内容的div,如何将此div转换为图像格式
I have a div with some contents ,How to convert this div into an image format
推荐答案
http://stackoverflow.com/questions/22984478/convert-div-into-image-data-using-jquery [< a href =http://stackoverflow.com/questions/22984478/convert-div-into-image-data-using-jquerytarget =_ blanktitle =New Window> ^ ]
http:// css-power。 blogspot.in/2013/06/div-width-400px-height-400px-background.html [ ^ ]
http://jsfiddle.net/8ypxW/3/ [ ^ ]
希望它有所帮助!
-KR
http://stackoverflow.com/questions/22984478/convert-div-into-image-data-using-jquery[^]
http://css-power.blogspot.in/2013/06/div-width-400px-height-400px-background.html[^]
http://jsfiddle.net/8ypxW/3/[^]
Hope it helps !
-KR
没有看到你想要做的事情的背景,我可以给你一个应该给你所需要的选项。
假设你的< div>有id ='xyz'。
图像显示可能类似于:
Not seeing the context of what you want to do, I can give you a option that should give you what you need.
Let's assume your <div> has id='xyz'.
An image presentation could be something like:
<img src='my.gif'>
然后你可以把它插入你的< div>使用以下内容:
Then you can insert it into your <div> with the following:
<script type='text/javascript'>
document.getElementById('xyz').innerHTML="<img src='my.gif'>";
</script>
这篇关于使用jquery / Javascript将div转换为图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文