(Created page with " <html> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/j...") |
|||
Line 356: | Line 356: | ||
</div> | </div> | ||
</div> | </div> | ||
+ | |||
+ | <script> | ||
+ | var myNav = document.getElementById('navigationbar'); | ||
+ | $(document).ready(function(){ | ||
+ | $(window).scroll(function() { // check if scroll event happened | ||
+ | if ($(document).scrollTop() > 120) { // check if user scrolled more than 50 from top of the browser window | ||
+ | |||
+ | myNav.style.opacity="0.9"; // if yes, then change the color of class "navbar-fixed-top" to white (#f8f8f8) | ||
+ | console.log("über 120"); | ||
+ | } else { | ||
+ | |||
+ | myNav.style.opacity="1"; // if not, change it back to transparent | ||
+ | console.log("unter 120"); | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | </script> | ||
</html> | </html> |
Revision as of 16:07, 14 October 2016