0
I have a code a function Avascript, and in the condition "IF" wanted to add one more parameter, Scrolltop side, because I just want to happen slideDown if the user of my site is on a computer screen. Take a look at him!
jQuery(document).ready(function($) {
$(function(){
var nav = $('.objeto');
$(window).scroll(function () {
if ($(this).scrollTop() >= 150) {
//nav.fadeIn();
$('#div').css("background","#06f2c9").slideDown(2000);
//$("#div").animate({background-color:"#333"});
} else {
nav.fadeOut();
}
});
});
});
div#div{
background-color:blue;
width:100%;
height:90px;
top:0px;
display:none;
position:fixed;
}
div#conteudo{
background-color:f9f9f9;
width:100%;
height:1000px;
margin:auto;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<body>
<div id="conteudo">
<div id="div" calss="objeto">Div para aparecer em tela de computador</div>
Role para baixo.
</div>
</body>
vlw my partner, more you
– Gerson Valdeir