Jump to content

TheOneTrueVlad

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by TheOneTrueVlad

  1. I have 3 variants of code that all do the same thing. Is there a best practice for choosing? Is it just appearance and ease of following or is there a technical reason to use one over the other? /*if ( ($(window).width() < 535) || ($(window).height() < 700) ) { if (scrollTop > stickyNavTop) { jQuery('body').addClass('stickynav'); } else { jQuery('body').removeClass('stickynav'); } } else { jQuery('body').removeClass('stickynav'); } if ( (scrollTop > stickyNavTop) && ( (($(window).height() < 700) || ($(window).width() < 535)) )) { jQuery('body').addClass('stickynav');} else { jQuery('body').removeClass('stickynav'); } if ( ((scrollTop > stickyNavTop) && ($(window).height() < 700)) || ((scrollTop > stickyNavTop) && ($(window).width() < 535)) ) { jQuery('body').addClass('stickynav');} else { jQuery('body').removeClass('stickynav'); } Cheers
×
×
  • Create New...