Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/471.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.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
Javascript 单句循环中的淡入字_Javascript_Jquery_Html - Fatal编程技术网

Javascript 单句循环中的淡入字

Javascript 单句循环中的淡入字,javascript,jquery,html,Javascript,Jquery,Html,我想做一个循环,在这个循环中,我能够从一个句子中淡出一个单词,但却无法执行。我已经找到了在这个平台上实现这一点的方法,只是为了满足我的需要而进行了更改,所以我不知道我的代码本身是否存在语法错误的问题。请帮忙 <DOCTYPE> <html lang="es"> <head> <link rel="stylesheet" href="main.css"> <!-- jQuery --> <script s

我想做一个循环,在这个循环中,我能够从一个句子中淡出一个单词,但却无法执行。我已经找到了在这个平台上实现这一点的方法,只是为了满足我的需要而进行了更改,所以我不知道我的代码本身是否存在语法错误的问题。请帮忙

<DOCTYPE>
<html lang="es">
  <head>
    <link rel="stylesheet" href="main.css">
    <!-- jQuery -->
    <script src="jquery-3.3.1.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

      <script type="text/javascript" src="main.js"></script>   

Nosotros construimos más que机器人

我刚刚删除了所有多余的代码,它似乎可以工作。顺便问一下,为什么要三次导入jQuery

$(函数(){
变量字=[
“人物角色”,
“comunidades”,
“基础设施”
],i=0;//i用于计数
setInterval(函数(){
$('#changeText').fadeOut(函数(){//fadeOut text
$(this.html(words[i=(i+1)%words.length]).fadeIn();//更新、计数和fadeIn
});
},2000);/2s
});

Nosotros construimos más que机器人

我刚刚删除了所有多余的代码,它似乎可以工作。顺便问一下,为什么要三次导入jQuery

$(函数(){
变量字=[
“人物角色”,
“comunidades”,
“基础设施”
],i=0;//i用于计数
setInterval(函数(){
$('#changeText').fadeOut(函数(){//fadeOut text
$(this.html(words[i=(i+1)%words.length]).fadeIn();//更新、计数和fadeIn
});
},2000);/2s
});

Nosotros construimos más que机器人

您的控制台中有错误吗?是的,上面写着“$”和“setInterval”不是定义的。您的控制台中有错误吗?是的,上面写着“$”和“setInterval”不是定义的