Javascript 如何在jquery中删除滑块的分页?
以下是滑块的脚本:Javascript 如何在jquery中删除滑块的分页?,javascript,jquery,html,css,pagination,Javascript,Jquery,Html,Css,Pagination,以下是滑块的脚本: <script> $(function(){ $('#slides').slides({ preload: true, preloadImage: 'img/loading.gif', play: 5000, pause: 2500, hoverPause: true, animationStart
<script>
$(function(){
$('#slides').slides({
preload: true,
preloadImage: 'img/loading.gif',
play: 5000,
pause: 2500,
hoverPause: true,
animationStart: function(current){
$('.caption').animate({
bottom:-35
},100);
if (window.console && console.log) {
// example return of current slide number
console.log('animationStart on slide: ', current);
};
},
animationComplete: function(current){
$('.caption').animate({
bottom:0
},200);
if (window.console && console.log) {
// example return of current slide number
console.log('animationComplete on slide: ', current);
};
},
slidesLoaded: function() {
$('.caption').animate({
bottom:0
},200);
}
});
});
</script>
$(函数(){
$(“#幻灯片”)。幻灯片({
预加载:正确,
预加载图像:“img/loading.gif”,
播放:5000,
暂停:2500,
悬停:是的,
animationStart:函数(当前){
$('.caption')。设置动画({
底部:-35
},100);
if(window.console&&console.log){
//返回当前幻灯片编号的示例
log('animationStart on slide:',当前);
};
},
动画完成:功能(当前){
$('.caption')。设置动画({
底部:0
},200);
if(window.console&&console.log){
//返回当前幻灯片编号的示例
log('animationComplete on slide:',当前);
};
},
slidesloadded:function(){
$('.caption')。设置动画({
底部:0
},200);
}
});
});
上面的脚本添加在标题部分,也包括这些
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="js/slides.min.jquery.js"></script>
包含在头标签中
以下是JSFIDLE链接:
在上面我添加了html和slides.min.jquery.js文件
当我在所有代码上方运行时,将显示分页。但我不需要。。所以我试着把它拿走。。但我不能。它仍然像数字一样显示
我的页面如下所示:
我需要,像这样的链接幻灯片工作
谁能帮我实现这个目标
提前谢谢。我尝试了分页设置,但设置为false
pagination: {
active: false
// [string] Can be either "slide" or "fade".
},
.......................
但它不起作用,所以更好的解决方案是使用display none到它的包装器
更新
根据新的更新和新的JS滑块
我所做的是->
$(function() {
$('#slides').crossSlide({
speed: 40,
fade: 1
}, [
{ src: 'http://securedcommunications.com/Include/Images/home/photo-2.jpg', dir: 'up', alt: 'Our Business is to Encrypt and Secure Your Communications', href: '#' },
{ src: 'http://securedcommunications.com/Include/Images/home/photo-2.jpg', dir: 'down', alt: 'The Solution for Secured Communications and Privacy.', href: '#' }
/* */
], function(idx, img, idxOut, imgOut) {
if (idxOut == undefined) {
if(idx == 0 || idx == 3 || idx == 6 || idx == 9){
document.getElementById('crossSlideCaption').style.marginTop = '-430px';
document.getElementById('crossSlideCaption').style.marginLeft = '-485px';
}else if(idx == 1 || idx == 4 || idx == 7 || idx == 10 || idx == 12){
document.getElementById('crossSlideCaption').style.marginTop = '-280px';
document.getElementById('crossSlideCaption').style.marginLeft = '-100px';
}else{
document.getElementById('crossSlideCaption').style.marginTop = '-52px';
document.getElementById('crossSlideCaption').style.marginLeft = '-485px';
};
$('div.caption').text(img.alt).animate({ opacity: 1.0 })
} else {
$('div.caption').animate({ opacity: 0 })
}});
$('div.caption').show().css({ opacity: 0 })
});
HTML
并在中添加2个JS文件
请正确制作Fiddle,以便我可以快速修改它。请检查您的JSFIDLE链接。它不工作。没有问题我自己做的,我正在检查问题您问“如何在jquery中从滑块删除分页?”我回答。要了解更多的功能,你可以问另一个问题。嗨,在你想要的网站的URL中可以看到,它使用的滑块插件与你的插件不同。它使用->插件。妈妈,你好,收到了。这就是我们称之为软件工程师/web开发人员的人:)->您现在明白了
web开发人员的职责吗?
,web开发人员是最聪明的人之一。谢谢。有点忙的人稍后会看到。我现在在公司做公司工作,我认为插件只支持图像。所以你可以通过编写自己的视频代码来扩展jQuery插件!:)Enjoy@rani您需要为视频添加功能,因此扩展插件!:)@rani mademji您正在使用此插件进行滑动图像->确定?因此您需要在这个JS文件中编写更多代码,以便它也可以用于视频。因此,如果您了解核心Javascript和jQuery,请修改插件并将其用于视频。
$(function() {
$('#slides').crossSlide({
speed: 40,
fade: 1
}, [
{ src: 'http://securedcommunications.com/Include/Images/home/photo-2.jpg', dir: 'up', alt: 'Our Business is to Encrypt and Secure Your Communications', href: '#' },
{ src: 'http://securedcommunications.com/Include/Images/home/photo-2.jpg', dir: 'down', alt: 'The Solution for Secured Communications and Privacy.', href: '#' }
/* */
], function(idx, img, idxOut, imgOut) {
if (idxOut == undefined) {
if(idx == 0 || idx == 3 || idx == 6 || idx == 9){
document.getElementById('crossSlideCaption').style.marginTop = '-430px';
document.getElementById('crossSlideCaption').style.marginLeft = '-485px';
}else if(idx == 1 || idx == 4 || idx == 7 || idx == 10 || idx == 12){
document.getElementById('crossSlideCaption').style.marginTop = '-280px';
document.getElementById('crossSlideCaption').style.marginLeft = '-100px';
}else{
document.getElementById('crossSlideCaption').style.marginTop = '-52px';
document.getElementById('crossSlideCaption').style.marginLeft = '-485px';
};
$('div.caption').text(img.alt).animate({ opacity: 1.0 })
} else {
$('div.caption').animate({ opacity: 0 })
}});
$('div.caption').show().css({ opacity: 0 })
});
<div id="container">
<div id="example">
<div id="slides" style="width:970px;height:430px;"></div>
<div id="" class="" style="position:relative; width:970px; margin:auto;" align="">
<div id="crossSlideCaption" class="caption">
</div>
</div>
</div>