如何对jquery背景效果添加淡入淡出效果?

时间:2018-01-30 11:12:39

标签: jquery hover click effect

您好我想对此jquery使用淡入效果,并在点击时将其显示在触控设备上。

  $('#one').hover(function() {
    $('#one_text').css('background-color', '#fdb913');
  }, function() {
    // on mouseout, reset the background colour
    $('#one_text').css('background-color', '');
  });

1 个答案:

答案 0 :(得分:0)

你可以试试这个

$('#one').hover(function() {
    $('#one_text').css('background-color', '#fdb913').fadeOut( 100 );
  }, function() {
    // on mouseout, reset the background colour
    $('#one_text').css('background-color', '').fadeIn( 500 );
  });

见Plunker https://plnkr.co/edit/tfYEihJ8Z2SfXP1ShAKL?p=preview

相关问题