【问题标题】:How do I put a fade effect on a jquery background effect?如何在 jquery 背景效果上添加淡入淡出效果?
【发布时间】:2018-01-30 11:12:39
【问题描述】:

您好,我想在这个 jquery 上使用淡入效果,并让它在点击时出现在触摸设备上。

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

【问题讨论】:

标签: jquery hover click effect


【解决方案1】:

你可以试试这个

$('#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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-10-15
    • 1970-01-01
    • 1970-01-01
    • 2011-10-16
    • 1970-01-01
    • 2011-01-01
    • 1970-01-01
    • 2011-06-30
    相关资源
    最近更新 更多