主要是备忘一下animate的参数设置方法

核心代码如下:

$(function(){
      
      $(
"#flash2 li a").hover(
        
function(){ 
            $(
this).animate(
                { paddingLeft:
"40px" },
                {duration: 
400
                 easing: 
"easeOutQuint",
                 complete:
function(){$(this).addClass("yel")} 
                 }
                ) },
        
function(){ 
            $(
this).animate(
                { paddingLeft:
"10px"  },
                {duration: 
400
                easing: 
"easeOutQuint",
                complete:
function(){$(this).removeClass("yel")}
                }
                ) }
        )
                   
    })

样式表:

a{ font-weight:900; padding:4px 6px;}
a:hover
{ color:#fff;}
script
{ display:block;}
.flash
{ width:400px; padding:10px; list-style:none; clear:both;}
.flash li
{ font-family:Arial, Helvetica, sans-serif; font-size:14px;  border-bottom:1px solid #ddd; clear:both; margin:0;}
.flash li a
{padding-left:10px; background:#f0f0f0; display:block; padding-right:10px;line-height:26px; height:26px;}
.flash li a:hover
{ color:#fff; background:#f0c;}
.flash li a.yel
{ color:#ff0;}

相关文章:

  • 2022-12-23
  • 2021-09-05
  • 2021-08-29
  • 2021-10-24
  • 2022-12-23
  • 2021-11-06
  • 2022-03-06
猜你喜欢
  • 2022-12-23
  • 2021-06-15
  • 2022-12-23
  • 2021-11-05
  • 2021-10-27
  • 2021-11-26
相关资源
相似解决方案