jQuery:根据滚动位置更改滑动div位置
当鼠标悬停在元素上时,尝试使隐藏的div向下或向上滑动。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%"}); }
$(".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%”});}