cancel
Showing results for 
Search instead for 
Did you mean: 

Sicky Navigation with Account-Cart-Wrapper

Sicky Navigation with Account-Cart-Wrapper

Hello,

 

i want to create a sticky Navigation within the Account-Cart-Wrapper Class.

The sticky Navigation works fine but the Account-Cart-Wrapper still freeze the Page.

 

The Code is:

<style>
    .fixedTop {
        clear: both;
        padding: 0px;
        background-color: rgb(0,102,204);
        z-index: 999;
        position: fixed;
        left: 0px;
        top: 0px;
        margin: 0px;
        width: 100%;
        transition: all 0.2s ease-in;
    }
    
    .fixedTop a{
        color: white;
    }


</style>

 

<script>

$j = jQuery.noConflict();
$j(window).scroll(function () {

 

if ($j(this).scrollTop() > 250) {
            $j("#header-nav").addClass('fixedTop');
            if(0 == $j("#header-nav").children("#account-cart-wrapper").length){
                $j(".account-cart-wrapper").clone().appendTo("#header-nav");
                alert($j("#header-nav").children("#account-cart-wrapper").length);
            } else {
                alert("hänge nicht dran ... is NULL");
            }

        } else {
            $j("#header-nav").removeClass('fixedTop');
        }
    });

 </script>

Hope there is someone with a solution for this problem.

 

Edit, sry i forgot a piece of code.