gpt4 book ai didi

javascript - Jquery NivoSlider slider 不工作 $ ('#slider' ).nivoSlider();不是函数

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:09:09 27 4
gpt4 key购买 nike

我在我的 asp.net 应用程序中使用 nivo jquery 图像 slider ,但是在页面加载后它没有改变图像并且只显示“loading.gif”图像,在 jquery 调试时我收到错误消息:$('#slider ').nivoSlider();不是函数。

   <link href="css/NivoSlideThemes/default/default.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/NivoSlideThemes/nivo-slider.css" rel="stylesheet" type="text/css" media="screen" />
<script src="js/menu/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="js/jquery.nivo.slider.pack.js" type="text/javascript"></script>

<script type="text/javascript">
$(window).load(function () {
$('#slider').nivoSlider();
});
</script>
<style>

.theme-default #slider {
margin:1px auto 0 auto;
width:674px; /* Make sure your images are the same size */
height:311px; /* Make sure your images are the same size */
}
.theme-pascal.slider-wrapper,
.theme-orman.slider-wrapper {
/* margin-top:150px; */
}

.clear {
clear:both;
}

</style>

<div class="slider-wrapper theme-default">
<div id="slider" class="nivoSlider">
<img src="images/cfgSliderImages/1.gif" alt="" />
<img src="images/cfgSliderImages/2.gif" alt="" title="Solar Power" />
<img src="images/cfgSliderImages/3.gif" alt="" data-transition="slideInLeft" />
<img src="images/cfgSliderImages/4.gif" alt="" title="#htmlcaption" />
</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>
</div>

最佳答案

试试这个:

可能和jQuery有冲突,所以使用.noConflict():

var j = jQuery.noConflict();
j(document).ready(function () {
j('#slider').nivoSlider();
});

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

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