Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.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
jQuery:根据滚动位置更改滑动div位置_Jquery_Html_Scroll_Slide - Fatal编程技术网

jQuery:根据滚动位置更改滑动div位置

jQuery:根据滚动位置更改滑动div位置,jquery,html,scroll,slide,Jquery,Html,Scroll,Slide,当鼠标悬停在元素上时,尝试使隐藏的div向下或向上滑动。Div向下/向上滑动必须根据滚动位置调整位置。有什么帮助吗 下面是我现有的一些代码 $(".team-box").hover(function () { $(".side-top").show(); if ($(window).scrollTop() - $(window).height() < $(this).offset().top){ $(".slide-top").css({top: "-130%"}); }

当鼠标悬停在元素上时,尝试使隐藏的div向下或向上滑动。Div向下/向上滑动必须根据滚动位置调整位置。有什么帮助吗

下面是我现有的一些代码

$(".team-box").hover(function () { $(".side-top").show(); 
if ($(window).scrollTop() - $(window).height() < $(this).offset().top){ 
    $(".slide-top").css({top: "-130%"}); 
}
$(.team-box”).hover(函数(){$(.side-top”).show();
如果($(窗口).scrollTop()-$(窗口).height()<$(此).offset().top){
$(“.slide-top”).css({top:-130%”);
}

谢谢

您尝试过哪些不起作用的方法?如果您发布代码并解释出现问题的地方,您更有可能在StackOverflow中获得更好的帮助。$(“.team box”).hover(函数(){$(.side top”).show();If($(窗口).scrollTop()-$(窗口).height()<$(此).offset().top){$(.slide top”).css({top:“-130%”});}