简体   繁体   中英

border color won't change

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 portion 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']...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM