开发者

border color won't change

开发者 https://www.devze.com 2022-12-16 02:34 出处:网络
I\'m trying to animate background-color,color and border color to change with jquery but for some reason border color is not changing any idea why? here is the port开发者_如何学Pythonion of jquery cod

I'm trying to animate background-color,color and border color to change with jquery but for some reason border color is not changing any idea why? here is the port开发者_如何学Pythonion of jquery code :

$('#tabbed a').hover(function() { 
        $(this).animate({ 
          backgroundColor: "#FBFBFB", 
          color:"#FD7A24",
          borderColor:"#000"
        }, "fast") 
      }, function() { 
        $(this).animate({ 
          backgroundColor: "#FFF",
          color:"#65B1D3",
          borderColor:"#eee"
        }, "fast") 
      });

Thank you


The jQuery Color Plugin doesn't support just borderColor. You need to supply all four sides:

$('#tabbed a').hover(function() { 
    $(this).animate({ 
      backgroundColor: "#FBFBFB", 
      color:"#FD7A24",
      borderLeftColor:  "#000",
      borderTopColor:   "#000",
      borderRightColor: "#000",
      borderBottomColor:"#000"
    }, "fast") 
  }, function() { 
    $(this).animate({ 
      backgroundColor: "#FFF",
      color:"#65B1D3",
      borderLeftColor:  "#eee",
      borderTopColor:   "#eee",
      borderRightColor: "#eee",
      borderBottomColor:"#eee"
    }, "fast") 
  });

You can see from line 10 of the source which properties it can animate:

...['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor']...
0

精彩评论

暂无评论...
验证码 换一张
取 消