如何使用jquery放大和缩小图像?
我有以下代码
<div class="c1">
<div class="d1">
<img />
<img />
<img />
</div>
</div>
1.标签中包含 GIF 图像。这些图像是透明的,其中某些部分用透明的黄色补丁突出显示。 2. css类应用于内部div类,并且在css类的帮助下将jpeg类型的背景图像分配给内部div类。 3. 外部 div 在应用的 css 类的帮助下变得可滚动。
我想在 jquery 的帮助下放大和缩小 div 内的图像。
那么是否可以借助jquery来放大和缩小图像呢? 它的简单代码是什么?
等待朋友们的回复!
谢谢你!
I have following code
<div class="c1">
<div class="d1">
<img />
<img />
<img />
</div>
</div>
1.There are GIF images included in tag. These images are transparent and some portion of them are highlighted with transparent yellow patch.
2. css class is applied to inner div class and there is a background image of type jpeg is assigned to inner div class with the help of css class.
3. The outside div is made scrollable with the help of css class applied to it.
I want to do zoom in and out on the image image inside div with the help of jquery.
so is it possible to zoom in and out the image with the help of jquery?
what is the simple code for it?
waiting for your replies friends!
Thank You!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
背景无法缩放,只有
标签可以。
您可以将图像放入 div 中,其中 div 具有
overflow:hidden;
,然后缩放图像。您可以在此处查看一个简单示例:
http://jsbin.com/ozugi3/2
http://jsbin.com/ozugi3/2/edit
Backgrounds cannot be scaled, only
<img>
tags can.You could put an image in a div, where the div has
overflow:hidden;
, and then scale the image.You can see an quick example here:
http://jsbin.com/ozugi3/2
http://jsbin.com/ozugi3/2/edit