淡入/淡出进入一个连续的循环

Getting fade in/out into a continual loop

本文关键字:一个 连续 循环 淡出 淡入      更新时间:2023-09-26

我有一个网站,我得到了spacebean的帮助。现在,我需要帮助将以下代码的淡入/淡出部分放入连续循环中,但我不知道该怎么做。我也希望目前出现在Mac/iPod/iPhone/iPad上的空白消失。它出现在点击计数器之前的最顶部。任何帮助,不胜感激。

代码如下:

$(document).ready(function(){
(function() 
{
    if (navigator.userAgent.match(/Mac OS X/i)
        || navigator.userAgent.match(/iPhone/i)
        || navigator.userAgent.match(/iPad/i)
        || navigator.userAgent.match(/iPod/i)
        ) 
  {
    isApple = true;
    if (confirm("Because this is a Apple device, It is not reccommended for you to view this site on this device. You will now be transferred to Google.com. I am working on a fix. Thank you for your patience.")){
      window.location = "https://www.google.com";
      }else{
      alert("It is NOT recommended that you view this site at this time. I am working on a fix. Please leave this site now.")}
  }else{
   loadFade();
  } 
})();
function loadFade(){
    $("#circ1").fadeIn();
    $("#circ2").fadeIn("slow");
    $("#circ3").fadeIn(800);
    $("#circ4").fadeIn(900);
    $("#circ5").fadeIn(1000);
    $("#circ6").fadeIn(1100);
    $("#circ7").fadeIn(1200);
    $("#circ8").fadeIn(1250);
    $("#circ9").fadeIn(1300);
    $("#circ10").fadeIn(1350);
    $("#circ11").fadeIn(1400);
    $("#circ12").fadeIn(1450);
    $("#circ13").fadeIn(1500);
    $("#circ14").fadeIn(1550);
    $("#circ15").fadeIn(1600);
    $("#circ1").fadeOut();
    $("#circ2").fadeOut("slow");
    $("#circ3").fadeOut(800);
    $("#circ4").fadeOut(900);
    $("#circ5").fadeOut(1000);
    $("#circ6").fadeOut(1100);
    $("#circ7").fadeOut(1200);
    $("#circ8").fadeOut(1250);
    $("#circ9").fadeOut(1300);
    $("#circ10").fadeOut(1350);
    $("#circ11").fadeOut(1400);
    $("#circ12").fadeOut(1450);
    $("#circ13").fadeOut(1500);
    $("#circ14").fadeOut(1550);
    $("#circ15").fadeOut(1600);
    };
});

只需使用淡出的最后一个项的回调即可再次调用该函数。

$("#circ15").fadeOut(1600, function () {
    loadFade();
});

在这里看到它的实际应用:http://jsfiddle.net/SD4G3/

要淡入/淡出进入连续循环,请尝试调用此函数:

function loadFade() {       
        for(var i=1; i<=15; i++) 
           $("#circ"+i).fadeToggle(loadFade); 
}

小心。。。它只是在一个无限循环中。这是一个演示。

该网站充斥着语法问题。

此代码在此处:

<!-- End 1FreeCounter.com code -->
</center>
</center><font color="#000000"><BR>

您可以看到连续两次关闭中心标记。 这在您的页面上无效。

在同一部分中,接下来的几行...

<!-- End 1FreeCounter.com code -->
</center>
</center><font color="#000000"><BR>
</body>
</html>
<img id="img0" style="position:absolute; left:0; top:1000; visibility:hidden;" src="happy.gif" />

您正在关闭您的正文和 html 标签(可能来自从其他网站复制/粘贴内容)。 正文和 html 标记应该是页面上的最后两件事,而不是页面中间。

再往下看,这段代码:

<h3><b><center><br>Hello. This is Josh's Website.</b></h3>

你有 h3 -> b -> 中心,但你只关闭了 b -> h3。 您没有关闭中心标记,也创建了无效的语法。

然后在第 134 行周围,你有这个:

</head>
<body>

在网站中间随机关闭头部标签,然后是正文标签(即使我们已经很好地进入了正文)。

错误还在继续,继续,继续...

强烈建议您学习一些基本的HTML,而不是在没有首先学习这些基础知识的情况下,将您在其他网站上找到的内容复制/粘贴到您自己的网站上。 令人惊讶的是,您的页面加载了...