Forwardwind (Talk | contribs) |
Forwardwind (Talk | contribs) |
||
Line 3: | Line 3: | ||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
− | $(document). | + | $(function () { |
+ | $(document).scroll(function () { | ||
+ | // new color for font | ||
+ | |||
+ | var $nav = $(".navbar"); | ||
+ | $nav.toggleClass('bg-dark', $(this).scrollTop() > $nav.height()); | ||
− | |||
− | |||
− | + | }); | |
− | + | }); | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | // tabs | |
− | + | ||
− | + | function openCity(cityName,elmnt,color) { | |
− | + | var i, tabcontent, tablinks; | |
− | + | tabcontent = document.getElementsByClassName("tabcontent"); | |
− | + | for (i = 0; i < tabcontent.length; i++) { | |
− | + | tabcontent[i].style.display = "none"; | |
− | + | } | |
− | + | tablinks = document.getElementsByClassName("tablink"); | |
− | + | for (i = 0; i < tablinks.length; i++) { | |
− | + | tablinks[i].style.backgroundColor = ""; | |
− | + | } | |
− | + | document.getElementById(cityName).style.display = "block"; | |
+ | elmnt.style.backgroundColor = color; | ||
+ | |||
+ | } | ||
+ | // Get the element with id="defaultOpen" and click on it | ||
+ | document.getElementById("defaultOpen").click(); | ||
+ | |||
Revision as of 21:11, 8 August 2018