jQuery在类中淡入淡出/设置图像动画

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jQuery在类中淡入淡出/设置图像动画相关的知识,希望对你有一定的参考价值。

  1. $('.projectHolder').hover(
  2.  
  3. function() { //This is the hover in function
  4.  
  5. $("img", this).stop(); //Stops any animation being done on the button
  6.  
  7. $("img", this).css({opacity:1}); //Changes the opacity back to not if not already
  8.  
  9. $("img", this).animate({opacity:0.5},400); //Now animates the opacity to the user defined value
  10.  
  11. },
  12.  
  13. function() { //This is the hover out function
  14.  
  15. $("img", this).animate({opacity:1},400); //Animates the opacity back to 1
  16.  
  17. }
  18.  
  19. )

以上是关于jQuery在类中淡入淡出/设置图像动画的主要内容,如果未能解决你的问题,请参考以下文章