The problem

by Alex Balu

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<div id="fixed_logo" >
		<div id="logo_nav_wrapper">
				<a href="#" style="background-color: transparent;">
                    <img src="http://www.mdvstyle.com/wp-content/themes/mdv-child/img/logo.png">
                </a>

		</div>
 </div>
    
       <!-- this div is only for scrolling-->     
            <div style="background-color:black; margin-top:800px; height:100px; width:100px;"></div>

CSS

#fixed_logo {
    position: fixed;
    top: 20%;
    left: 50%;
    width: 150px;
    height: 150px;
    margin: -75px 0 0 -75px;
    z-index: 999;
}

#logo_nav_wrapper {
    max-width: 1200px;
    margin: 0 auto;}


    div#logo_nav_wrapper a
     {background-color:transparent;
    display: block!important;
    position: relative;
    width: 150px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0);
    position: absolute;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-border-radius: 50%;
    border-radius: 50%;
}

.sticky_logo {
	 position: fixed;
    left: 0!important;
    margin: 0!important;
    top: 0!important;
    width: 100%!important;
    height: auto!important;
    position:fixed !important;
    background-color: rgb(17, 17, 17);

}

JavaScript

$(document).ready(function(){
	var $document = $(document);
    
    $document.scroll(function(){
    if ($document.scrollTop() >= 50) ){
    	$("#fixed_logo").addClass("sticky_logo");
    
    
    }
    
    
    });




})