【发布时间】:2014-06-10 09:59:49
【问题描述】:
我正在尝试设置三个带有偏移位置的航路点,第一个航路点工作得非常好并且在正确的偏移位置 (75%) 开火,但是位于 Flexslider Carousel 之后的第二个和第三个航路点不是在正确的偏移位置射击。由于 Carousel 改变了页面的高度尺寸,第二个和第三个航路点在页面向下滚动很多时触发,然后需要,因此增加了实际偏移位置。
我曾尝试致电$.waypoints('refresh'),但我没有任何运气。我的代码如下。
// first-flexslider
$(window).load(function() {
$('#firstSlider').flexslider({
animation: "slide",
directionNav: false,
controlNav: true,
});
});
// second-flexslider
$(window).load(function() {
$('#secondSlider').flexslider({
animation: "slide",
directionNav: false,
controlNav: false,
});
});
$('.prev, .next').on('click', function() {
var href = $(this).attr('href');
$('#secondSlider').flexslider(href)
return false;
})
$(document).ready(function(){
$.waypoints('refresh');
});
// waypoints
$(document).ready(function() {
$('.wp1').waypoint(function() {
$('.wp1').addClass('animated fadeInUp');
}, {
offset: '75%'
});
$('.wp2').waypoint(function() {
$('.wp2').addClass('animated fadeInUp');
}, {
offset: '75%'
});
$('.wp3').waypoint(function() {
$('.wp3').addClass('animated fadeInUpD');
}, {
offset: '75%'
});
});
我希望找出解决这个问题的方法,并让第二和第三航点在正确的偏移位置 (75%) 开火。如果您需要更多信息,请告诉我。谢谢。
【问题讨论】:
标签: javascript jquery html twitter-bootstrap jquery-waypoints