2010-02-05 68 views
3

我有以下代码如何使用jquery放大和缩小图像?

<div class="c1"> 
    <div class="d1"> 
     <img /> 
     <img /> 
     <img /> 
    </div> 
</div> 

1.有包含在标签GIF图像。这些图像是透明的,它们的一部分用透明黄色补丁高亮显示。 2. css类应用于内部div类,并且有类型jpeg的背景图像在css类的帮助下被分配给内部div类。 3.外部div可以通过应用于它的css类的帮助进行滚动。

我想借助jquery在div内的图像图像上进行放大和缩小。

所以有可能放大和缩小图像的帮助下jQuery的? 它的简单代码是什么?

等待你的回复啦!

谢谢!

回答

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"> 
0

试试这个link放大图像配与这段代码很好的结合在一起。