簡體   English   中英

單擊鏈接后通過滾動引導Bootstrap Navi閃爍

[英]Bootstrap navi flickering by scrolling after clicking to a link

我有固定的頂部導航。 我在Bootstrap 3中有這個導航。在我的頁面上,我有幾個鏈接,其中包含svg映像。 通過將鼠標懸停在鏈接上,它開始上下移動。 當我單擊這些鏈接時,我的頁面會平滑向下滾動到特定位置。 但是,當我單擊這些鏈接后嘗試向下或向上滾動時,導航在chrome中開始閃爍。 但是,當我用鼠標單擊頁面上的任意位置時,它停止閃爍。

可能是什么問題,或者如何模擬頁面上任何地方的mouseclick?

我試過了:

$('body').click();

但是它現在確實起作用了。

這是我的網站: http : //mival.de/examples/mival/index.html

當您單擊黑色箭頭並在鍍鉻頁面之后滾動時,導航開始閃爍。

JS滾動

//jQuery to collapse the navbar on scroll
$(window).scroll(function() {
    if ($(".navbar").offset().top > 50) {
        $(".navbar-fixed-top").addClass("top-nav-collapse");
    } else {
        $(".navbar-fixed-top").removeClass("top-nav-collapse");
    }
});

//jQuery for page scrolling feature - requires jQuery Easing plugin
$(function() {
    $('a.page-scroll').bind('click', function(event) {
        var $anchor = $(this);
        $('html, body').stop().animate({
            scrollTop: $($anchor.attr('href')).offset().top
        }, 1500, 'easeInOutExpo');
        event.preventDefault();
        setTimeout(function() {
            $('#homeSection').click();
        }, 500);
    });

});

好的,找到解決方案。 剛剛在我的arrow:hover類中添加了以下內容:

 -webkit-perspective: 1000;
 -webkit-backface-visibility: hidden;

並不真正知道它在做什么,但是它有效!

PS:除此之外,我將我的translateY規則的度量標准從em更改為px。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM