Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jQuery航路点未在正确位置触发_Javascript_Jquery_Html_Twitter Bootstrap_Jquery Waypoints - Fatal编程技术网

Javascript jQuery航路点未在正确位置触发

Javascript jQuery航路点未在正确位置触发,javascript,jquery,html,twitter-bootstrap,jquery-waypoints,Javascript,Jquery,Html,Twitter Bootstrap,Jquery Waypoints,我正在尝试设置三个具有偏移位置的航路点,第一个航路点工作完全正常,并在正确的偏移位置(75%)开火,但位于Flexslider转盘之后的第二和第三个航路点没有在正确的偏移位置开火。由于转盘改变了页面的高度尺寸,第二个和第三个航路点在页面向下滚动一段时间后触发,因此增加了实际的偏移位置 我曾尝试调用$.waypoints('refresh'),但我没有任何幸运。我的代码如下 // first-flexslider $(window).load(function() { $('#firstSli

我正在尝试设置三个具有偏移位置的航路点,第一个航路点工作完全正常,并在正确的偏移位置(75%)开火,但位于Flexslider转盘之后的第二和第三个航路点没有在正确的偏移位置开火。由于转盘改变了页面的高度尺寸,第二个和第三个航路点在页面向下滚动一段时间后触发,因此增加了实际的偏移位置

我曾尝试调用
$.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%)开火。如果您需要更多信息,请告诉我。谢谢。

Flexslider有一个回调API,您可以在执行各种操作后执行函数:

我会检查
之后的
回调,可能还有
开始的
回调,并从那里调用refresh。例如:

$('#secondSlider').flexslider({
  animation: "slide",
  directionNav: false,
  controlNav: false,
  after: function() {
    $.waypoints('refresh');
  }
});

嘿,伙计,非常感谢你指出这一点。我使用
start
回调调用了refresh,它工作起来就像做梦一样。再次感谢!