gpt4 book ai didi

jquery - $ ('#slider' ).nivoSlider();不是一个函数

转载 作者:行者123 更新时间:2023-12-01 00:51:53 25 4
gpt4 key购买 nike

首先,我一直在研究类似的问题,但没有任何结果,这是我的问题。

我可以在本地完美地设置nivo slider ,但是当我复制并粘贴完全相同的内容并且我正在谈论文件夹和文件夹中的位置到我的网络酒店时,我收到以下错误:

$('#slider').nivoSlider(); is not a function

我已经工作了几个小时了,但没有任何结果,它开始让我生气:S

这是我的文件夹结构的一些图像,我突出显示了重要文件所在的位置:

我的索引文件

<!DOCTYPE html>
<?php
include 'includes/page.class.php';
$url = isset($_REQUEST['url']) ? $_REQUEST['url'] : null;
$page = ($url != null) ? new page($url) : new page();
?>
<html>
<head>

<link href="site/css/custom.css" rel="stylesheet" type="text/css"
media="screen" />
<link href="site/css/template.css" rel="stylesheet" type="text/css"
media="screen" />
<link href="themes/bar/bar.css" rel="stylesheet" type="text/css"
media="screen" />
<link href="site/css/hint.css" rel="stylesheet" type="text/css"
media="screen" />
<link href="fancybox/jquery.fancybox.css" rel="stylesheet" type="text/css" media="screen" />


<link rel="stylesheet" href="nivo-slider.css" type="text/css" media="screen" />
<script src="jquery.nivo.slider.pack.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>

<script type="text/javascript" src="Javascripts/index.js"></script>
<script type="text/javascript" src="Javascripts/kontakt.js"></script>
<script type="text/javascript" src="Javascripts/ommig.js"></script>
<script type="text/javascript" src="Javascripts/projekter.js"></script>
<script type="text/javascript" src="Javascripts/android.js"></script>
<script type="text/javascript" src="fancybox/jquery.fancybox.pack.js"></script>

<title><?php echo $page->getTitle() ?>
</title>
</head>
<body>
<div id="wrapper">
<div id="header">
<nav class="menu">
<ul>
<li><a href="forside.php" id="mainsite">Forside</a></li>
<li><a href="projekter.php" id="mainsite">Projekter</a></li>
<li><a href="ommig.php" id="aboutme">Om mig</a></li>
<li><a href="kontakt.php" id="mainsite">kontakt</a></li>
</ul>
</nav>
<hr>
</div>
<div id="page">
<div id="content">
<?php echo $page->loadPage() ?>
</div>
</div>
<div class="slider-wrapper">
<div id="slider" class="nivoSlider">
<img src="images/nemo.jpg" alt="" />
<a href="http://dev7studios.com"><img src="images/toystory.jpg" alt="" title="#htmlcaption" /></a>
<img src="images/up.jpg" alt="" title="This is an example of a caption" />
<img src="images/walle.jpg" alt="" />
</div>
</div>
<div id="htmlcaption" class="nivo-html-caption">
<strong>This</strong> is an example of a <em>HTML</em> caption with <a href="#">a link</a>.
</div>
<script type="text/javascript">
$(window).load(function () {
$('#slider').nivoSlider();
});
</script>
<div id="footer">
<hr>
<div id="credits">
<p style="text-align: center;">
<b>&copy; Design by | Marc Rasmussen</b>
</p>
</div>
</div>
</div>
</body>
</html>

My folder that contains my website

Firebug 消息

enter image description here

最佳答案

您应该在 nivoSlider 之前获取 jQuery:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="jquery.nivo.slider.pack.js" type="text/javascript"></script>

关于jquery - $ ('#slider' ).nivoSlider();不是一个函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17415716/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com