如何使用jQuery缩放图像?

3
我有以下代码
<div class="c1">
    <div class="d1">
         <img />
         <img />
         <img />
    </div>
</div>

1. 在标签中包含了GIF图片。这些图片是透明的,其中一部分被透明的黄色贴片所突出显示。 2. css类被应用于内部div类,并且通过css类为内部div类分配了jpeg类型的背景图像。 3. 通过应用于外部div的css类,使其可滚动。

我想使用jquery在div内对图像进行缩放。

那么是否可能使用jquery对图像进行缩放?有什么简单的代码吗?

等待您的回复朋友们!

谢谢!

2个回答

1

0
    ****here is the script****
       <script src="Script/jquery-1.7.1.min.js" type="text/javascript"></script>
      <script type="text/javascript">
        $(document).ready(function () {
            $('#Img1, #Img2, #Img3').mouseover(function () {
                $(this).animate({ width: "122px", height: "110px" }, 100);
            });
            $('#Img1, #Img2, #Img3').mouseout(function () {
                $(this).animate({ width: "118px", height: "106px" }, 100);
            });
        });
      </script>
**Aspx code**
<img src="Images/home.jpg" id="Img1" width="118" height="106" border="0">
<img src="Images/machine.jpg" id="Img2" width="118" height="106" border="0">
<img src="Images/title_Mixie.jpg" id="Img3" width="118" height="106" border="0">

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接