Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
带Jquery的FadeIn淡出和扭曲_Jquery_Fadein_Fadeout - Fatal编程技术网

带Jquery的FadeIn淡出和扭曲

带Jquery的FadeIn淡出和扭曲,jquery,fadein,fadeout,Jquery,Fadein,Fadeout,我正在尝试创建一个悬停动作,它会带来一个彩色图像,而且一旦移除悬停,它会淡出原始图像 在这个论坛上,在Funka和Brad的帮助下,我在第一张图片中看到了它的褪色点,但是我需要得到它,这样一旦你停下来,它就会褪色 目前,它淡出图像为空白,然后淡入新图像。然后,无论我是否将鼠标悬停在off(关闭)位置,它都将保持不变 我喜欢它,所以它看起来像是彩色图像正在通过黑色和白色的一个衰落,相当于在衰落之前衰落到0…以及恢复一旦悬停被删除 任何帮助都将不胜感激 //Loop through the imag

我正在尝试创建一个悬停动作,它会带来一个彩色图像,而且一旦移除悬停,它会淡出原始图像

在这个论坛上,在Funka和Brad的帮助下,我在第一张图片中看到了它的褪色点,但是我需要得到它,这样一旦你停下来,它就会褪色

目前,它淡出图像为空白,然后淡入新图像。然后,无论我是否将鼠标悬停在off(关闭)位置,它都将保持不变

我喜欢它,所以它看起来像是彩色图像正在通过黑色和白色的一个衰落,相当于在衰落之前衰落到0…以及恢复一旦悬停被删除

任何帮助都将不胜感激

//Loop through the images and print them to the page
   for (var i=0; i < totalBoxes; i++){
    $.ajax({
     url: "random.php?no=",
     cache: false,
     success: function(html) {
      // following line I originally suggested, but let's make it better...
      //$('#bg').append(html).fadeIn('slow');
      // also note the fine difference between append and appendTo.
      var $d = $(html).hide().appendTo('#bg').fadeIn('slow');
      $('img', $d).hover(function() {
       var largePath = $(this).attr("rel");
       $(this).fadeOut("slow", function() {
        $(this).attr({ src: largePath }).fadeIn("slow");
       });
      });
     }
    });
   }
//循环浏览图像并将其打印到页面上
对于(变量i=0;i
您的鼠标悬停只有鼠标悬停功能-在鼠标悬停时执行某些操作

$('img', $d).hover(function() {
    //This is the mouseover function
    var largePath = $(this).attr("rel");
    $(this).fadeOut("slow", function() {
        $(this).attr({ src: largePath }).fadeIn("slow");
    }
    );
},
function() {
    //This is the mouseout function!  Do something here!
});

我真的不知道jQuery,但是如果我一直在使用的代码听起来像您可能想要的,那么下面的代码就是。我将它与精灵图像一起使用,以阻止某些浏览器中出现的恼人的闪烁

$(function() {
    $(".fadebtn")
    .find("span")
    .hide()
    .end()
    .hover(function() {
            $(this).stop(true, true).find("span").fadeIn(600);
    }, function() {
            $(this).stop(true, true).find("span").fadeOut(200);
    });
});

有人能帮我解决这个问题吗?你有没有尝试过我在你上次问的关于这个问题的问题上给你的不透明的想法?也许你应该链接到你以前的问题,并提供一个工作示例。。就像在。。。如果你不能立即得到答案,通常意味着你的问题需要澄清。