Tag: nav

jQuery用第一个替换每个元素的带()

尝试复制页面上的第一个.postNav并用它替换所有后续.postNav 。 我已经简化了,逻辑似乎正确,但该函数仅在我传递字符串时才起作用,而不是元素。 JS小提琴! http://jsfiddle.net/cwMhh/1/ HTML: link to header link to other posts link to other posts link to other posts link to other posts link to other posts JavaScript的: $(‘.postNav:gt(0)’).each(function(){ $(this).replaceWith($(‘.postNav:eq(0)’)); });

Jquery动画导航颜色

嗨,我现在正在制作一个网站,我在动画导航栏时遇到了麻烦。 我希望导航栏最初是透明的,而不是在某个div之后更改背景颜色。 我已经这样做了,但希望背景颜色淡入,而不仅仅是出现。 下面是HTML和Jquery。 如何让它淡入背景色? HTML Home About Services Portfolio Contact jQuery的 $(document).ready(function(){ var scroll_start = 0; var startchange = $(‘#c-title’); var offset = startchange.offset(); $(document).scroll(function() { scroll_start = $(this).scrollTop(); if(scroll_start > offset.top) { $(‘.nav’).css(‘background-color’, ‘rgba(34,34,34,0.9)’); } else { $(‘.nav’).css(‘background-color’, ‘transparent’); } }); }); 感谢您抽出宝贵时间回答这个问题。 (我希望问题很清楚,如果不让我知道)

jQuery Owl Carousel 2隐藏导航

我正在构建一个带有’Owl Carousel 2’的漂亮内容滑块,只有当只有一个或多个项目可见时才可以隐藏导航按钮吗? 当只有一个项目或两个项目可见时,他们会在div.item上附加第二个CSS类? 喜欢:当有一个项目时:类“第一项”,当有两个框时:class =“item two”当有超过2时,那么它将只有class =“item”。 JS: jQuery(“#sliderwhat”).owlCarousel({ loop : true, nav : true }); HTML: Personal guide / Amsterdam Here some text bla bla bla.

jquery在滚动时改变不透明度和高度

我正在尝试写一些小js。 我的导航将渐变设置为背景。 当我向下滚动一定量时,我希望背景改变高度,从渐变到平面颜色,0.85不透明度(动画)。 这是我的js代码 $(window).scroll(function(){ if ($(window).scrollTop() >= 600){ $(‘#navigation’).css({height: ’92px’}); } else { $(‘#navigation’).css({height: ‘142px’}); } }); 这是css #navigation { height: 142px; width: 1350px; position: fixed; z-index: 2000; background: -moz-linear-gradient(top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0.75)), color-stop(100%,rgba(0,0,0,0))); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, rgba(0,0,0,0.75) 0%,rgba(0,0,0,0) 100%); /* […]

如何在向下滚动页面时使导航栏改变颜色?

我希望导航栏是透明的,但是当您向下滚动页面时,它会变为红色,例如。 Home About Services Portfolio Contact