What I want is that this jQuery {
<script type="text/javascript" class="navegacion_header">
jQuery(function(){
jQuery(window).scroll(function(){
if(jQuery(this).scrollTop() > 200) {
jQuery('#logo-img img')
$( "#logo-img img" ).addClass( “logo_cambio” );
.attr('src','<?php echo get_template_directory_uri() ?>/images/logo-tva2.png');
}
if(jQuery(this).scrollTop() < 200) {
jQuery('#logo-img img')
.css({'width':'113px','height':'168px', 'margin-top':'0',
'-webkit-transition':'all 0.5s ease',
'-moz-transition':'all 0.5s ease',
'-ms-transition':'all 0.5s ease',
'-o-transition':'all 0.5s ease',
'transition':'all 0.5s ease'
})
.attr('src','<?php echo get_template_directory_uri() ?>/images/logo-tva2.png');
}
});
});
</script>
You can detect this class in the CSS file:
.logo_cambio{
width:51px;
height:73px;
margin-top:-7.5%;
}
Now try adding this method $( "p" ).addClass( “logo_cambio” );
But it does not work for me.