出于某些原因,这在firefox和iexplore中有效,但在chrome中不起作用。它被认为是隐藏的子菜单,直到鼠标滚过它-在铬鼠标悬停清楚地工作时,颜色变化等,但菜单不弹出!你能提供的任何帮助都将是令人惊叹的!谢谢!!
#menu, #menu ul
{
margin:0px;
padding:0px;
list-style:none;
list-style-position:outside;
position:relative;
line-height:2em; /* this would mean the element is double the height of the
粘性导航栏“跳跃” 我最近做了一个导航栏,滚动时会粘在屏幕的顶部(进入网页时会从中间开始)。我在mac上做了这件事,一切都很好。然而,当我进入windows桌面上的网页时,整个导航栏要么跳过,跳过一些内容,要么出现小故障,使我无法继续向下滚动。 1)是macOS/windows还是safari/chrome之间的差异导致了这种情况的发生? 2)如何修复? // When the user scrolls the page, execute myFunction
window.onscroll = function() {stickyNavbar()};
// Get the heade
我有两个div实例,一旦到达scrollTop,它们就会从相对位置转换为固定位置。然而,我正在寻找一种方法来关闭一个功能,一旦一个脚注div滚动到。如果您查看此页面上的侧栏,您可以更好地理解我想要实现的目标,
一旦页面到达底部页脚div,我需要将侧边栏设置回位置:相对,以便它不会覆盖页面的其余部分,并能够随着内容部分向上滚动。
下面是我正在使用的当前jQuery脚本。任何帮助或建议都是非常感谢的!
<script>
$(function() {
// grab the initial top offset of the navigation
var sticky
我在我的html page.Now中使用了一个java脚本,我将该脚本移动到了一个外部的js文件中。下面是脚本(jful.js)
<script type="text/javascript">
$(function() {
// grab the initial top offset of the navigation
var sticky_navigation_offset_top = $('#catnav').offset().top;
// our function that decides weather the
这是我的密码
// Get the navbar
let navbar = document.getElementById("navigation");
// Get the offset position of the navbar
let sticky = navbar.offsetTop;
// Add the sticky class to the navbar when you reach its scroll position. Remove "sticky" when you leave the scroll position
function
我创建了一个侧栏,其中有三个容器元素。当用户滚动页面时,我希望它们是粘性的,当用户到达页脚时,我希望这些元素表现得像普通元素,而不是相互重叠。
下面是表示问题的代码。如何解决这一重叠问题?
<div class="sidebar">
<div class="sidebar-subscription-form-container">
<div class="sidebar-subscription-form">
<p>I would hold all the subscript
我试图使position: sticky和display: flex属性在Internet 11上工作。
它在Chrome、Firefox和Edge上工作得很好,但令人惊讶的是,它不适用于11。
<div class="flexbox-wrapper">
<div class="regular">
This is the regular box
</div>
<div class="sticky">
This is the sticky box
</div&
如何在滚动期间设置导航的宽度。在滚动时,导航适合100%的宽度。如果我将宽度设置为500px而不是它的左侧:0位置。在左边我不能设置自动居中导航。
$(function() {
var sticky_navigation_offset_top = $('#sticky_navigation').offset().top;
var sticky_navigation = function(){
var scroll_top = $(window).scrollTop(); // our current vertical position fr
我创建了一个效果,就是在滚动文本的同时不断地显示图像。我有一个问题,如何让它以同样的方式工作,而不是position: sticky,posititon: fixed,这样这个效果就可以在ie上工作了。 var sticky = document.querySelector('.sticky-container');
var img = document.querySelector('.sticky-item');
window.addEventListener('scroll',setSticky);
function s
我有一个“粘性导航”,“粘住”到顶部(函数将其位置更改为:fixed,top:0),当用户向下滚动通过它时。我在页面顶部的区域也有一个'expandalbe‘标志。第一个问题是,当我在页面顶部展开标牌时,肚脐“粘住”的位置发生了变化。现在,当面板打开时,我让它粘住,但是当它关闭时,它粘在了错误的点上(似乎粘在#面板的附加高度点上)。见小提琴
如何使#sticky_navigation保持在顶部:0在这两种情况下-当#面板是打开和关闭/默认的?
(已删除死YouTube链接)
谢谢
**// FIRST VERSION sticky navigaiton ------------/
尝试在的右侧边栏中制作一个粘性横幅,但不知道如何在页脚上的红线前几个像素定义它的停止点。有人能帮帮忙吗。脚本:
$(function(){ // document ready
if (!!$('#sticky').length) { // make sure "#sticky" element exists
var el = $('#sticky');
var stickyTop = $('#sticky').offset().top -100;
$(window).scroll(function(){ //
希望使用机车滚动框架()在粘性div中创建具有以下结构的水平滚动部分。我的HTML如下:
<div id="sec01" class="the-height-400vh-section"><!-- this has the same height as does the 400vh width, timing should match -->
<div class="the-sticky-div" id="sticky" data-scroll data-scroll-sticky data