Javascript elGallen滑块中的图像都是外部源,因此您应该能够看到所有这些图像。我删除了这张照片中不相关的“logo”图片。有四个导航链接,所以我不知道为什么你只能看到两个。事实上,我在一列火车上,正要换另一辆,在去姐姐家吃饭的路上。以后再看。如果在此期间有人帮忙
Javascript elGallen滑块中的图像都是外部源,因此您应该能够看到所有这些图像。我删除了这张照片中不相关的“logo”图片。有四个导航链接,所以我不知道为什么你只能看到两个。事实上,我在一列火车上,正要换另一辆,在去姐姐家吃饭的路上。以后再看。如果在此期间有人帮忙,javascript,jquery,html,slider,clone,Javascript,Jquery,Html,Slider,Clone,elGallen滑块中的图像都是外部源,因此您应该能够看到所有这些图像。我删除了这张照片中不相关的“logo”图片。有四个导航链接,所以我不知道为什么你只能看到两个。事实上,我在一列火车上,正要换另一辆,在去姐姐家吃饭的路上。以后再看。如果在此期间有人帮忙,那就更好了!我建议在实际问题中更新小提琴链接。@RachelGallen听起来不错,谢谢!谢谢你的帮助,但这实际上似乎不起作用。使用上面的toggleSlides功能,单击“bliss”导航选项卡,然后开始使用右滑块箭头。你被困在最后三个的无
elGallen滑块中的图像都是外部源,因此您应该能够看到所有这些图像。我删除了这张照片中不相关的“logo”图片。有四个导航链接,所以我不知道为什么你只能看到两个。事实上,我在一列火车上,正要换另一辆,在去姐姐家吃饭的路上。以后再看。如果在此期间有人帮忙,那就更好了!我建议在实际问题中更新小提琴链接。@RachelGallen听起来不错,谢谢!谢谢你的帮助,但这实际上似乎不起作用。使用上面的toggleSlides功能,单击“bliss”导航选项卡,然后开始使用右滑块箭头。你被困在最后三个的无限循环中slides@JordanBarber对不起,乔丹。现在检查一下。我已经编辑了答案。让我知道它是否有效。@JordanBarber更新了小提琴链接。旧的没有更新……天哪。非常感谢你!我很抱歉你看了这么久。谢谢你的帮助!总是乐于助人:)
GiftSlider = {
prev: '.slider-container .prev',
next: '.slider-container .next',
slide: '.slide',
slidesContainer: '#slides',
navLink: '.gift-nav li a',
init: function() {
// Initialize nextSlide function when clicking right arrow
$(this.next).click(this.nextSlide.bind(this));
$(this.next).click(this.activeTabs.bind(this));
// Initialize prevSlide function when clicking left arrow
$(this.prev).click(this.prevSlide.bind(this));
$(this.prev).click(this.activeTabs.bind(this));
// Initialize toggleSlides and activeTab functions when clicking nav links
$(this.navLink).click(this.toggleSlides.bind(this));
$(this.navLink).click(this.activeTabs.bind(this));
},
nextSlide: function(e) {
// Prevent default anchor click
e.preventDefault();
// Set the current slide
var currentSlide = $('.slide.current');
// Set the next slide
var nextSlide = $('.slide.current').next();
// remove the current class from the current slide
currentSlide.removeClass("current");
// Move the current slide to the end so we can cycle through
currentSlide.clone().appendTo(this.slidesContainer);
// remove the last slide so there is not two instances
currentSlide.remove();
// Add current class to next slide to display it
nextSlide.addClass("current");
},
prevSlide: function(e) {
// Prevent defaulct anchor click
e.preventDefault();
// Set the current slide
var currentSlide = $('.slide.current');
// Set the last slide
var lastSlide = $('.slide').last();
// remove the current class from the current slide
currentSlide.removeClass("current");
// Move the last slide to the beginning so we can cycle through
lastSlide.clone().prependTo(this.slidesContainer);
// remove the last slide so there is not two instances
lastSlide.remove();
// Add current class to new first slide
$('.slide').first().addClass("current");
},
toggleSlides: function(e) {
// Prevent defaulct anchor click
e.preventDefault();
var itemData = e.currentTarget.dataset.index;
var currentSlide = $('.slide.current');
currentSlide.removeClass("current");
newSlide = $('#slide-' + itemData);
// currentSlide.clone().appendTo(this.slidesContainer);
newSlide.addClass("current");
// console.log(newSlide);
},
activeTabs: function() {
// *** This could be much simpler if we didnt need to match the slider buttons
// *** up with nav tabs. Because I need to track the slider as well, I have
// *** made this its own function to be used in both instances
// get the active slide
var activeSlide = $('.slide').filter(':visible');
// get the active slide's id
var currentId = activeSlide.attr('id');
// grab just the number from the active slide's id
var currentNum = currentId.slice(-1);
// remove any active gift-nav links
$(this.navLink).removeClass("active");
// get the current tab by matching it to the current slide's id
var currentTab = $('.gift-nav li a[data-index="' + currentNum + '"]');
// make that active
currentTab.addClass("active");
}
}
$(document).ready(function(){
// Init our objects
GiftSlider.init();
});
toggleSlides: function(e) {
// Prevent defaulct anchor click
e.preventDefault();
var itemData = e.currentTarget.dataset.index;
var currentSlide = $('.slide.current');
currentSlide.removeClass("current");
newSlide = $('#slide-' + itemData);
//currentSlide.clone().appendTo(this.slidesContainer);
newSlide.prev().clone().appendTo(this.slidesContainer);
newSlide.addClass("current");
//console.log("In toggle slide: "+newSlide.next().attr("id"));
//console.log("In toggle slide: "+newSlide.prev().attr("id"));
//console.log("In toggle slide: "+$('.slide.current').next().attr("id"));
},
toggleSlides: function(e) {
// Prevent defaulct anchor click
e.preventDefault();
var itemData = e.currentTarget.dataset.index;
var currentSlide = $('.slide.current');
currentSlide.removeClass("current");
newSlide = $('#slide-' + itemData);
//keep new slide at the beginning and move the preceding slides to the end
newSlide.nextAll().addBack().prependTo(this.slidesContainer);
//console.log("NewSlide.next: "+newSlide.next().attr('id') + "NewSlide.next.next: "+newSlide.next().next().attr('id')+"newSlide.next.next.next: "+newSlide.next().next().next().attr('id'));
//currentSlide.clone().appendTo(this.slidesContainer);
newSlide.addClass("current");
// console.log(newSlide);
},