-3
Good to script :
$(document).ready(function(){
$("#banner").css({"height":$(window).height() + "px"});
var flag = false;
var scroll;
$(window).scroll(function(){
scroll = $(window).scrollTop();
if(scroll > 200){
if(!flag){
$("#logo").css({"margin-top": "-5px", "width": "50px","height":"50px"});
$("nav").css({"color": "#fff"});
$("ul").css({"color": "#000"});
flag = true;
}
}else{
if(flag){
$("#logo").css({ "width": "80px","height":"80px"});
$("ul").css({"color": "#000"});
$("header").css({"background-color": "#fff"});
flag = false;
}
}
});
});
Html part of Nav:
<header class="header">
<nav>
<ul>
<a href="http://www.keyquotes.es"><li>Youtube</li></a>
<a href="http://www.keyquotes.es"><li>Nosotros</li></a>
<a href="http://www.keyquotes.es"><li>Contacto</li></a>
</ul>
<img id="logo" src="pictures/logo.png">
<ul>
<a href="http://www.keyquotes.es"><li>Youtube</li></a>
<a href="http://www.keyquotes.es"><li>Nosotros</li></a>
<a href="http://www.keyquotes.es"><li>Contacto</li></a>
</ul>
</nav>
</header>
I wanted to understand what is missing or where I am missing, my intention with this script is that when the page is in the top ul gets black img:
and when rolling the scroll it turns white as in img:
And then I added this to the script: $("ul"). css({"color": "#000"}); and $("ul"). css({"color": "#fff"}); and was not the best option?
can explain what Voce wants
– Marcelo Batista
I left it well explained, but like you saw in img the <ul><li> is black, but I wanted to add in the script when scrolling the bar the <ul><li> change the color to white .
– Felipe
can post the full code from html
– Marcelo Batista
but you need html, it’s just not in the script?
– Felipe
I’ll edit here then .
– Felipe
@Marcelobatista ready bro .
– Felipe
Put the entire HTML code, including CSS and JS, will make it easier to help you.
– hugocsl