Hey I am new in jquery and i am stuck, I have html like this
<section id="help">Help</section>
<section id="touch">Touch</section>
<section id="payment">Payment</section>
<section id="toys">Toys</section>
So now if touch section is in viewport then add class to body (body class name is "touch-active")
and i am trying this code but it is not working for me:
jQuery(document).ready(function(){
if (jQuery('section').is(':visible')){
jQuery('body').addClass(.attr('id + active'));;
}
});
Thanks in advance :)